Browse Source

GDScript: Revert extra deletion when creating instance

Revert part of e4af39cbc00446b03d142882a69813e94f0838b2 that was causing
a crash.
George Marques 7 năm trước cách đây
mục cha
commit
b1187b9a2f
1 tập tin đã thay đổi với 1 bổ sung4 xóa
  1. 1 4
      modules/gdscript/gdscript.cpp

+ 1 - 4
modules/gdscript/gdscript.cpp

@@ -126,10 +126,7 @@ GDScriptInstance *GDScript::_create_instance(const Variant **p_args, int p_argco
 		GDScriptLanguage::singleton->lock->unlock();
 #endif
 
-		if (r_error.error != Variant::CallError::CALL_OK) {
-			memdelete(instance);
-			ERR_FAIL_COND_V(r_error.error != Variant::CallError::CALL_OK, NULL); //error constructing
-		}
+		ERR_FAIL_COND_V(r_error.error != Variant::CallError::CALL_OK, NULL); //error constructing
 	}
 
 	//@TODO make thread safe