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.
This commit is contained in:
George Marques
2023-04-26 10:57:22 -03:00
parent e2e870c611
commit abbdf80643
3 changed files with 17 additions and 4 deletions

View File

@@ -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")

View File

@@ -0,0 +1,2 @@
GDTEST_OK
It is freed