summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/runtime
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-05-24 19:52:32 +0200
committerGitHub <noreply@github.com>2021-05-24 19:52:32 +0200
commit215e43242c2a5b2ec5a8ccb4d26d716f965cbbd9 (patch)
treee44aa26a8c2af357ab5f648e5de45ff73801be05 /modules/gdscript/tests/scripts/runtime
parentc321f6ff4742d72e1863c69702ea6af47066965c (diff)
parentea44744e2daf512ac97ba7176d1e65d77b4f8042 (diff)
Merge pull request #49037 from vnen/fix-callable-freed-crash
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime')
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.gd5
-rw-r--r--modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.out6
2 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.gd b/modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.gd
new file mode 100644
index 0000000000..10780b5379
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.gd
@@ -0,0 +1,5 @@
+func test():
+ var node := Node.new()
+ var inside_tree = node.is_inside_tree
+ node.free()
+ inside_tree.call()
diff --git a/modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.out b/modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.out
new file mode 100644
index 0000000000..e585c374e2
--- /dev/null
+++ b/modules/gdscript/tests/scripts/runtime/errors/callable_call_after_free_object.out
@@ -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.