1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #44617 from geekrelief/gdnative_unload

free library when no nativescripts reference it
This commit is contained in:
Rémi Verschelde
2021-01-26 15:52:33 +01:00
committed by GitHub

View File

@@ -1724,6 +1724,12 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) {
S->get().erase(script);
if (S->get().size() == 0) {
library_script_users.erase(S);
Map<String, Ref<GDNative>>::Element *G = library_gdnatives.find(script->lib_path);
if (G) {
G->get()->terminate();
library_gdnatives.erase(G);
}
}
}
#ifndef NO_THREADS