MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / ~GDScriptInstance

Method ~GDScriptInstance

modules/gdscript/gdscript.cpp:2184–2202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2182}
2183
2184GDScriptInstance::~GDScriptInstance() {
2185 MutexLock lock(GDScriptLanguage::get_singleton()->mutex);
2186
2187 while (SelfList<GDScriptFunctionState> *E = pending_func_states.first()) {
2188 // Order matters since clearing the stack may already cause
2189 // the GDSCriptFunctionState to be destroyed and thus removed from the list.
2190 pending_func_states.remove(E);
2191 GDScriptFunctionState *state = E->self();
2192 ObjectID state_id = state->get_instance_id();
2193 state->_clear_connections();
2194 if (ObjectDB::get_instance(state_id)) {
2195 state->_clear_stack();
2196 }
2197 }
2198
2199 if (script.is_valid() && owner) {
2200 script->instances.erase(owner);
2201 }
2202}
2203
2204/************* SCRIPT LANGUAGE **************/
2205

Callers

nothing calls this directly

Calls 8

firstMethod · 0.80
selfMethod · 0.80
_clear_connectionsMethod · 0.80
_clear_stackMethod · 0.80
removeMethod · 0.45
get_instance_idMethod · 0.45
is_validMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected