From e173710963c3316833ac2e2c26ab3830551fd790 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 --- 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 ceb5b76ff2a..cec8bb9bd11 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 : tweens) { + tween->clear(); + } + tweens.clear(); } void SceneTree::quit(int p_exit_code) {