mirror of
https://github.com/godotengine/godot.git
synced 2024-10-23 21:51:35 +00:00
Update cached singletons when reloading GDScripts
This commit is contained in:
parent
5df9867967
commit
8cdbec0434
|
@ -2323,6 +2323,19 @@ void GDScriptLanguage::reload_all_scripts() {
|
||||||
}
|
}
|
||||||
elem = elem->next();
|
elem = elem->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
// Reload all pointers to existing singletons so that tool scripts can work with the reloaded extensions.
|
||||||
|
List<Engine::Singleton> singletons;
|
||||||
|
Engine::get_singleton()->get_singletons(&singletons);
|
||||||
|
for (const Engine::Singleton &E : singletons) {
|
||||||
|
if (globals.has(E.name)) {
|
||||||
|
_add_global(E.name, E.ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//as scripts are going to be reloaded, must proceed without locking here
|
//as scripts are going to be reloaded, must proceed without locking here
|
||||||
|
|
Loading…
Reference in New Issue
Block a user