ソースを参照

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

Bastiaan Olij 4 年 前
コミット
ae7675065a
1 ファイル変更1 行追加1 行削除
  1. 1 1
      modules/gdnative/nativescript/nativescript.cpp

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

@@ -1728,7 +1728,7 @@ void NativeScriptLanguage::unregister_script(NativeScript *script) {
 			library_script_users.erase(S);
 			library_script_users.erase(S);
 
 
 			Map<String, Ref<GDNative>>::Element *G = library_gdnatives.find(script->lib_path);
 			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();
 				G->get()->terminate();
 				library_gdnatives.erase(G);
 				library_gdnatives.erase(G);
 			}
 			}