Merge pull request #45953 from BastiaanOlij/no_unload_non_reloadable

Only unload the library if the reloadable flag is true
This commit is contained in:
Rémi Verschelde 2021-02-14 12:17:14 +01:00 committed by GitHub
commit b9aa2d0dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}