Fix possible Tween leak on exit

(cherry picked from commit e173710963)
This commit is contained in:
Haoyu Qiu 2022-12-15 19:09:09 +08:00
parent 9056cc9c2a
commit b2e5c8fe10
1 changed files with 6 additions and 0 deletions

View File

@ -777,6 +777,12 @@ void SceneTree::finish() {
E->get()->release_connections();
}
timers.clear();
// Cleanup tweens.
for (List<Ref<SceneTreeTween>>::Element *E = tweens.front(); E; E = E->next()) {
E->get()->clear();
}
tweens.clear();
}
void SceneTree::quit(int p_exit_code) {