Delete objects enqueued for deletion during SceneTree destruction
This commit is contained in:
parent
26b3aff01d
commit
23dac24789
|
@ -570,7 +570,11 @@ void SceneTree::finalize() {
|
||||||
root = nullptr;
|
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) {
|
for (Ref<SceneTreeTimer> &timer : timers) {
|
||||||
timer->release_connections();
|
timer->release_connections();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue