MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / finalize

Method finalize

scene/main/scene_tree.cpp:846–875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

844}
845
846void SceneTree::finalize() {
847 _flush_delete_queue();
848
849 _flush_ugc();
850
851 if (root) {
852 root->_set_tree(nullptr);
853 root->_propagate_after_exit_tree();
854 memdelete(root); //delete root
855 root = nullptr;
856
857 // In case deletion of some objects was queued when destructing the `root`.
858 // E.g. if `queue_free()` was called for some node outside the tree when handling NOTIFICATION_PREDELETE for some node in the tree.
859 _flush_delete_queue();
860 }
861
862 MainLoop::finalize();
863
864 // Cleanup timers.
865 for (Ref<SceneTreeTimer> &timer : timers) {
866 timer->release_connections();
867 }
868 timers.clear();
869
870 // Cleanup tweens.
871 for (Ref<Tween> &tween : tweens) {
872 tween->clear();
873 }
874 tweens.clear();
875}
876
877void SceneTree::quit(int p_exit_code) {
878 _THREAD_SAFE_METHOD_

Callers

nothing calls this directly

Calls 5

memdeleteFunction · 0.85
_set_treeMethod · 0.80
release_connectionsMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected