summaryrefslogtreecommitdiff
path: root/modules/gdnative
diff options
context:
space:
mode:
authorThomas Herzog <thomas.herzog@mail.com>2018-01-14 01:40:48 +0100
committerGitHub <noreply@github.com>2018-01-14 01:40:48 +0100
commit859ac6233d79a8e699de7f8cd2d16238d8887dfe (patch)
tree40f99fa2b68a26ac689eebcfcf4b3cecab863764 /modules/gdnative
parent6a4521da2ae0b08f42001c2c38396b28a2549c14 (diff)
parent567d20fe5f392c8d58f8c1488a24d72a24a098c6 (diff)
Merge pull request #15684 from karroffel/nativescript-windows-editor-crash
[GDNative] fix editor crash with NativeScript
Diffstat (limited to 'modules/gdnative')
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp
index e9e3180835..f45217d031 100644
--- a/modules/gdnative/nativescript/nativescript.cpp
+++ b/modules/gdnative/nativescript/nativescript.cpp
@@ -835,12 +835,14 @@ NativeScriptLanguage::~NativeScriptLanguage() {
for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) {
- L->get()->terminate();
- NSL->library_classes.clear();
- NSL->library_gdnatives.clear();
- NSL->library_script_users.clear();
+ if (L->get().is_valid())
+ L->get()->terminate();
}
+ NSL->library_classes.clear();
+ NSL->library_gdnatives.clear();
+ NSL->library_script_users.clear();
+
#ifndef NO_THREADS
memdelete(mutex);
#endif