summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-15 22:09:32 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-15 22:09:32 +0100
commit5dda8ec88d301948db5c81d47c17e78f2e1cab52 (patch)
tree49535faa6b16585eca2d14cac73c70cf86e1c11d
parent1bbbb037c1d59ba6ad72687bac2de9dde205114b (diff)
parente173710963c3316833ac2e2c26ab3830551fd790 (diff)
Merge pull request #70103 from timothyqiu/tween-cleanup
Fix possible Tween leak on exit
-rw-r--r--scene/main/scene_tree.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index ceb5b76ff2..cec8bb9bd1 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -594,6 +594,12 @@ void SceneTree::finalize() {
timer->release_connections();
}
timers.clear();
+
+ // Cleanup tweens.
+ for (Ref<Tween> &tween : tweens) {
+ tween->clear();
+ }
+ tweens.clear();
}
void SceneTree::quit(int p_exit_code) {