Browse Source

Merge pull request #45953 from BastiaanOlij/no_unload_non_reloadable

Only unload the library if the reloadable flag is true
Rémi Verschelde 4 years ago
parent
commit
b9aa2d0dfb
1 changed files with 1 additions and 1 deletions
  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);
 
 			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);
 			}