mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
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.
(cherry picked from commit abbdf80643)
This commit is contained in:
committed by
Rémi Verschelde
parent
aff0340486
commit
21bb5b9c0e
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user