Make Callable not crash on call when the object has been freed
Also add a GDScript test for this case.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
func test():
|
||||
var node := Node.new()
|
||||
var inside_tree = node.is_inside_tree
|
||||
node.free()
|
||||
inside_tree.call()
|
||||
@@ -0,0 +1,6 @@
|
||||
GDTEST_RUNTIME_ERROR
|
||||
>> SCRIPT ERROR
|
||||
>> on function: test()
|
||||
>> runtime/errors/callable_call_after_free_object.gd
|
||||
>> 5
|
||||
>> Attempt to call function 'null::is_inside_tree (Callable)' on a null instance.
|
||||
Reference in New Issue
Block a user