MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / DeconstructScriptObject

Method DeconstructScriptObject

neo/game/Entity.cpp:3144–3163  ·  view source on GitHub ↗

================ idEntity::DeconstructScriptObject Called during idEntity::~idEntity. Calls the destructor on the script object. Can be overridden by subclasses when a thread doesn't need to be allocated. Not called during idGameLocal::MapShutdown. ================ */

Source from the content-addressed store, hash-verified

3142================
3143*/
3144void idEntity::DeconstructScriptObject( void ) {
3145 idThread *thread;
3146 const function_t *destructor;
3147
3148 // don't bother calling the script object's destructor on map shutdown
3149 if ( gameLocal.GameState() == GAMESTATE_SHUTDOWN ) {
3150 return;
3151 }
3152
3153 // call script object's destructor
3154 destructor = scriptObject.GetDestructor();
3155 if ( destructor ) {
3156 // start a thread that will run immediately and be destroyed
3157 thread = new idThread();
3158 thread->SetThreadName( name.c_str() );
3159 thread->CallFunction( this, destructor, true );
3160 thread->Execute();
3161 delete thread;
3162 }
3163}
3164
3165/*
3166================

Callers

nothing calls this directly

Calls 6

GameStateMethod · 0.45
GetDestructorMethod · 0.45
SetThreadNameMethod · 0.45
c_strMethod · 0.45
CallFunctionMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected