forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GDScript] Fix lifetime of call base object
Ensures that the lifetime of an `Object` outlasts calls to it Also adds a check to `Object::~Object()` to check for locked state
- Loading branch information
1 parent
f360ed5
commit 6f6c2dc
Showing
4 changed files
with
47 additions
and
0 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
26 changes: 26 additions & 0 deletions
26
modules/gdscript/tests/scripts/runtime/features/ref_counted_lifetime.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,26 @@ | ||
# https://github.com/godotengine/godot/issues/86788 | ||
|
||
extends Node | ||
|
||
class MyClassTyped: | ||
func enter(outer): | ||
outer.my_class_typed = MyClassTyped.new() | ||
exit() | ||
|
||
func exit(): | ||
pass | ||
|
||
class MyClassUnTyped: | ||
func enter(outer): | ||
outer.my_class_untyped = MyClassUnTyped.new() | ||
exit() | ||
|
||
func exit(): | ||
pass | ||
|
||
var my_class_typed := MyClassTyped.new() | ||
var my_class_untyped = MyClassUnTyped.new() | ||
|
||
func test(): | ||
my_class_typed.enter(self) | ||
my_class_untyped.enter(self) |
1 change: 1 addition & 0 deletions
1
modules/gdscript/tests/scripts/runtime/features/ref_counted_lifetime.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 @@ | ||
GDTEST_OK |