We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
finish
1 parent 6d6e822 commit 3e14ac0Copy full SHA for 3e14ac0
1 file changed
modules/gdscript/gdscript.cpp
@@ -2192,6 +2192,15 @@ void GDScriptLanguage::finish() {
2192
}
2193
finishing = true;
2194
2195
+ // Destruct and detach instances that still exist.
2196
+ // Other systems might try to call/destruct them which will crash if `GDScriptLanguage` is not around anymore.
2197
+ for (const SelfList<GDScript> *E = script_list.first(); E != nullptr; E = E->next()) {
2198
+ const Ref<GDScript> script = E->self();
2199
+ while (script->instances.first() != nullptr) {
2200
+ script->instances.first()->self()->get_owner()->set_script(Variant());
2201
+ }
2202
2203
+
2204
// Clear the cache before parsing the script_list
2205
GDScriptCache::clear();
2206
0 commit comments