You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
GDScript: Cancel suspended functions when reloading a script
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# TODO: This test is currently disabled since it triggers some complex memory leaks. Try enabling it again once GH-101830 is fixed.
|
||||
|
||||
signal finished
|
||||
|
||||
const scr: GDScript = preload("reload_suspended_function_helper.notest.gd")
|
||||
|
||||
func test():
|
||||
@warning_ignore("UNSAFE_METHOD_ACCESS")
|
||||
scr.test(self)
|
||||
@warning_ignore("RETURN_VALUE_DISCARDED")
|
||||
scr.reload(true)
|
||||
finished.emit()
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_RUNTIME_ERROR
|
||||
>> WARNING: Canceling suspended execution of "test" due to a script reload.
|
||||
@@ -0,0 +1,3 @@
|
||||
static func test(a):
|
||||
await a.finished
|
||||
pass
|
||||
Reference in New Issue
Block a user