summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_vm.cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2023-04-26 10:57:22 -0300
committerGeorge Marques <george@gmarqu.es>2023-04-26 10:57:22 -0300
commitabbdf806435aad401f2a7b6ce09838c8e4d5cbcb (patch)
tree46454fdb137416b8fe92306084140f39bf67e71b /modules/gdscript/gdscript_vm.cpp
parente2e870c6118f6e9463c8907c947102f913f543de (diff)
downloadredot-engine-abbdf806435aad401f2a7b6ce09838c8e4d5cbcb.tar.gz
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.
Diffstat (limited to 'modules/gdscript/gdscript_vm.cpp')
-rw-r--r--modules/gdscript/gdscript_vm.cpp4
1 files changed, 0 insertions, 4 deletions
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;