Skip to content
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

Fix parent inconsistency in Node::remove_child #78019

Merged

Conversation

Sauermann
Copy link
Contributor

NOTIFICATION_CHILD_ORDER_CHANGED could be triggered, while there was an inconsistent state:

  • parent node no longer had child listed as child
  • child node still had parent node listed as parent

Bring these two in sync, before emitting the notification.

resolve #77870

`NOTIFICATION_CHILD_ORDER_CHANGED` could be triggered, while there
was an inconsistent state:
- parent node no longer had child listed as child
- child node still had parent node listed as parent

Bring these two in sync, before emitting the notification.
@Sauermann Sauermann requested a review from a team as a code owner June 8, 2023 20:52
@akien-mga akien-mga added this to the 4.1 milestone Jun 8, 2023
Copy link
Member

@RedworkDE RedworkDE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a branch with basically the exact same change: master...RedworkDE:inconsistent-child so I think the change is correct (and it solves the problem)

I left it at that over concerns about code that might depend on that weird state, given the age of this behavior, but such code is now broken anyways with the changed notification, so this change is safe now and it is better to keep nodes in a consistent state.

@akien-mga akien-mga merged commit fd2f339 into godotengine:master Jun 9, 2023
@Sauermann Sauermann deleted the fix-remove-child-inconsistency branch June 9, 2023 09:09
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node tree state is inconsistent during NOTIFICATION_CHILD_ORDER_CHANGED
3 participants