Răsfoiți Sursa

Only unload the library when no NativeScript objects exist if the reloadable flag is true. If it is false it is likely the library does other things and can't be unloaded

(cherry picked from commit ae7675065a3eebf2a61a5bdc5b5e103a7f869a78)
Bastiaan Olij 4 ani în urmă
părinte
comite
8aa022f99c
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      modules/gdnative/nativescript/nativescript.cpp

+ 1 - 1
modules/gdnative/nativescript/nativescript.cpp

@@ -1530,7 +1530,7 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) {
 			library_script_users.erase(S);
 
 			Map<String, Ref<GDNative> >::Element *G = library_gdnatives.find(script->lib_path);
-			if (G) {
+			if (G && G->get()->get_library()->is_reloadable()) {
 				G->get()->terminate();
 				library_gdnatives.erase(G);
 			}