From b2e5c8fe10c8b77f7fcecc1a771e5611ca7a0ac9 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 15 Dec 2022 19:09:09 +0800 Subject: [PATCH] Fix possible Tween leak on exit (cherry picked from commit e173710963c3316833ac2e2c26ab3830551fd790) --- scene/main/scene_tree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 774ed869e7f..e1103496782 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -777,6 +777,12 @@ void SceneTree::finish() { E->get()->release_connections(); } timers.clear(); + + // Cleanup tweens. + for (List>::Element *E = tweens.front(); E; E = E->next()) { + E->get()->clear(); + } + tweens.clear(); } void SceneTree::quit(int p_exit_code) {