Explorar o código

Fixed attempt to delete NULL pointer error

Fixed: Error cause by attemptng to delete a NULL pointer.
unregister_gdnative_types() now checks discoverer to see if it is NULL
before deleting. After selecting a godot project to edit (in Win10), the
discoverer_callback() wasn't called thus discoverer was NULL.
bncastle %!s(int64=8) %!d(string=hai) anos
pai
achega
fc83821316
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/gdnative/register_types.cpp

+ 1 - 1
modules/gdnative/register_types.cpp

@@ -248,7 +248,7 @@ void unregister_gdnative_types() {
 	memdelete(GDNativeCallRegistry::singleton);
 
 #ifdef TOOLS_ENABLED
-	if (Engine::get_singleton()->is_editor_hint()) {
+	if (Engine::get_singleton()->is_editor_hint() && discoverer != NULL) {
 		memdelete(discoverer);
 	}
 #endif