You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Removes the gdnative library when no script (gdns) references it any longer. This enables hot reload for gdnative.
This commit is contained in:
@@ -1724,6 +1724,12 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) {
|
|||||||
S->get().erase(script);
|
S->get().erase(script);
|
||||||
if (S->get().size() == 0) {
|
if (S->get().size() == 0) {
|
||||||
library_script_users.erase(S);
|
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
|
#ifndef NO_THREADS
|
||||||
|
|||||||
Reference in New Issue
Block a user