-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some Tweeners are leaking references #52699
Comments
godot/scene/main/scene_tree.cpp Line 1126 in 98a7bf3
|
Disregard my question above. I've reproduced this issue. extends Node2D
var tween1: Tween
var tween2: Tween
func _ready():
tween1 = create_tween()
tween2 = create_tween()
tween1 = create_tween()
|
Just a report, OS: macOS 12.3/arm64 |
This reverts commit a1b1dbb. Godot 3.5 introduced SceneTreeTweens, but these are still buggy and result in reference leaks. When running Turbo Fat's puzzle mode, the number of nodes gradually increases from 1,000 to 2,000, 3,000, and keeps growing without limit. After a few minutes the game becomes choppy and unplayable. Removing the SceneTreeTweens fixes the problem. We can restore this code once Godot #52699 is closed, and SceneTreeTweens work as intended. See godotengine/godot#52699
Godot version
32f8f74
System information
W10
Issue description
Related to #51231
Tween and Tweeners had a circular reference, which prevented them from being freed properly (this was fixed by #51237)
However, Tween is still not being destroyed. Also if you use typed variable for tween, some Tweeners aren't destroyed too, which makes me think it's some GDScript bug. Here's test code:
Run the scene, press any key and check the object Monitor. When animation starts, 5 objects are created and only 4 are destroyed when it ends; 1 object leaks (the Tween). When you switch to the commented line (so the tween is typed), 3 objects are leaked (Tween, IntervalTweener and CallbackTweener).
Steps to reproduce
See above.
Minimal reproduction project
You can compile engine with this patch for easier debugging:
0001-Add-Tween-destructor-prints.txt
The text was updated successfully, but these errors were encountered: