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

Method cancel_pending_functions

modules/gdscript/gdscript.cpp:1641–1660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1639}
1640
1641void GDScript::cancel_pending_functions(bool warn) {
1642 MutexLock lock(GDScriptLanguage::get_singleton()->mutex);
1643
1644 while (SelfList<GDScriptFunctionState> *E = pending_func_states.first()) {
1645 // Order matters since clearing the stack may already cause
1646 // the GDScriptFunctionState to be destroyed and thus removed from the list.
1647 pending_func_states.remove(E);
1648 GDScriptFunctionState *state = E->self();
1649#ifdef DEBUG_ENABLED
1650 if (warn) {
1651 WARN_PRINT("Canceling suspended execution of \"" + state->get_readable_function() + "\" due to a script reload.");
1652 }
1653#endif
1654 ObjectID state_id = state->get_instance_id();
1655 state->_clear_connections();
1656 if (ObjectDB::get_instance(state_id)) {
1657 state->_clear_stack();
1658 }
1659 }
1660}
1661
1662GDScript::~GDScript() {
1663 if (destructing) {

Callers 1

_prepare_compilationMethod · 0.80

Calls 7

firstMethod · 0.80
selfMethod · 0.80
get_readable_functionMethod · 0.80
_clear_connectionsMethod · 0.80
_clear_stackMethod · 0.80
removeMethod · 0.45
get_instance_idMethod · 0.45

Tested by

no test coverage detected