Merge pull request #15684 from karroffel/nativescript-windows-editor-crash

[GDNative] fix editor crash with NativeScript
This commit is contained in:
Thomas Herzog 2018-01-14 01:40:48 +01:00 committed by GitHub
commit 859ac6233d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -835,12 +835,14 @@ NativeScriptLanguage::~NativeScriptLanguage() {
for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) {
L->get()->terminate(); if (L->get().is_valid())
NSL->library_classes.clear(); L->get()->terminate();
NSL->library_gdnatives.clear();
NSL->library_script_users.clear();
} }
NSL->library_classes.clear();
NSL->library_gdnatives.clear();
NSL->library_script_users.clear();
#ifndef NO_THREADS #ifndef NO_THREADS
memdelete(mutex); memdelete(mutex);
#endif #endif