소스 검색

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

[GDNative] fix editor crash with NativeScript
Thomas Herzog 7 년 전
부모
커밋
859ac6233d
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      modules/gdnative/nativescript/nativescript.cpp

+ 6 - 4
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