-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that SceneTree is initialized and finalized at correct time #72248
Ensure that SceneTree is initialized and finalized at correct time #72248
Conversation
Added one more pull request as follow up to this #72266 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the changes, it's logical to:
- in
SceneTree::initialize
firstly initialize the base class (callMainLoop::initialize
), then doSceneTree
-specific initialization (set tree for theroot
), - in
SceneTree::finalize
firstly finalize theSceneTree
-related stuff, then finalize the base class (callMainLoop::finalize
).
It's the same ordering as for constructors/destructors.
@akien-mga Kinda related as both are fixing some aspects of likely not-so-logical initialization order for |
cde35da
to
8d1dcd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for early testing in 4.2.
Needs a rebase though :) |
SceneTree should be fully initialized before any tree operation with any node and finalized only after all nodes exited tree.
8d1dcd3
to
83f065c
Compare
@RandomShaper Could you also look into this #70771 ? It would be nice to have both fixes in upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As already mentioned in #72248 (review) this initialization/finalization order makes more sense to me.
Can't think of anything this change could break besides the cases where user implements custom MainLoop
extending SceneTree
, and somehow relies on the previous ordering of these callbacks. I find this unlikely though.
Looks good for early testing in 4.2.
☝️
Thanks! Yeah, we're aiming to merge this for 4.2 dev1. |
Thanks! |
SceneTree should be fully initialized before any tree operation with any node and finalized only after all nodes exited tree.
Accounts only for in-tree operations, not constructors. After fix init-deinit order will be:
Partially fixes #71695