-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GDScript: Cancel suspended functions when reloading a script
- Loading branch information
1 parent
06acfcc
commit a507002
Showing
7 changed files
with
49 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
modules/gdscript/tests/scripts/runtime/errors/reload_suspended_function.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
signal finished | ||
|
||
const scr: GDScript = preload("reload_suspended_function.notest.gd") | ||
|
||
func test(): | ||
@warning_ignore("UNSAFE_METHOD_ACCESS") | ||
scr.test(self) | ||
@warning_ignore("RETURN_VALUE_DISCARDED") | ||
scr.reload(true) | ||
finished.emit() |
3 changes: 3 additions & 0 deletions
3
modules/gdscript/tests/scripts/runtime/errors/reload_suspended_function.notest.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
static func test(a): | ||
await a.finished | ||
pass |
2 changes: 2 additions & 0 deletions
2
modules/gdscript/tests/scripts/runtime/errors/reload_suspended_function.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
GDTEST_RUNTIME_ERROR | ||
>> WARNING: Canceling suspended execution of "test" due to a script reload. |