mirror of
https://github.com/godotengine/godot
synced 2024-09-05 06:18:39 +00:00
Merge pull request #76483 from vnen/gdscript-dont-fail-returning-freed-object
GDScript: Don't fail when freed object is return
This commit is contained in:
commit
352ebe9725
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
# https://github.com/godotengine/godot/issues/68184
|
||||
|
||||
var node: Node:
|
||||
get:
|
||||
return node
|
||||
set(n):
|
||||
node = n
|
||||
|
||||
|
||||
func test():
|
||||
node = Node.new()
|
||||
node.free()
|
||||
|
||||
if !is_instance_valid(node):
|
||||
print("It is freed")
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_OK
|
||||
It is freed
|
Loading…
Reference in a new issue