diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-08 18:10:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-08 18:10:11 +0200 |
commit | 034d43def74c83e1d64db2c5c151f2c9da68810f (patch) | |
tree | d590d37fc11ef79ca66189fa1416f5c2f6352d4b | |
parent | 26b3aff01d5b9832ced1fb2fcdd14abeab4ca4b8 (diff) | |
parent | 23dac247895cc92288f7d69c24aab65a0717735c (diff) |
Merge pull request #53571 from kleonc/scene-tree-free-objects-queued-during-destruction
-rw-r--r-- | scene/main/scene_tree.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 3d07e4473d..a122241cd0 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -570,7 +570,11 @@ void SceneTree::finalize() { root = nullptr; } - // cleanup timers + // In case deletion of some objects was queued when destructing the `root`. + // E.g. if `queue_free()` was called for some node outside the tree when handling NOTIFICATION_PREDELETE for some node in the tree. + _flush_delete_queue(); + + // Cleanup timers. for (Ref<SceneTreeTimer> &timer : timers) { timer->release_connections(); } |