From abbdf806435aad401f2a7b6ce09838c8e4d5cbcb Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 26 Apr 2023 10:57:22 -0300 Subject: GDScript: Don't fail when freed object is return This is check is a bit too eager. The user should be able to handle the return value even if it's a freed object. --- modules/gdscript/gdscript_vm.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'modules/gdscript/gdscript_vm.cpp') diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 7098e4cd40..0855a670df 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -1651,10 +1651,6 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a bool was_freed = false; Object *obj = ret->get_validated_object_with_check(was_freed); - if (was_freed) { - err_text = "Got a freed object as a result of the call."; - OPCODE_BREAK; - } if (obj && obj->is_class_ptr(GDScriptFunctionState::get_class_ptr_static())) { err_text = R"(Trying to call an async function without "await".)"; OPCODE_BREAK; -- cgit v1.2.3