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] Improvement to Entity.destroy #4354

Merged
merged 1 commit into from
Jun 22, 2022
Merged

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jun 22, 2022

Fixes #3954

  • when the child is removed from the array, clear the parent as well, before calling destroy, to avoid it from trying to remove it from the array again
  • use pop instead of shift, which is faster, and we don't really care about the order of children destruction.

@mvaligursky mvaligursky self-assigned this Jun 22, 2022
@mvaligursky mvaligursky added bug area: graphics Graphics related issue labels Jun 22, 2022
@slimbuck
Copy link
Member

Could there be logic that depends on still being parented when destroyed?

@mvaligursky
Copy link
Contributor Author

Could there be logic that depends on still being parented when destroyed?

I would hope not, but this is hard to find out.

@mvaligursky mvaligursky merged commit 34ad9f2 into main Jun 22, 2022
@mvaligursky mvaligursky deleted the entity-destroy-improvement branch June 22, 2022 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling Entity#destroy can cause invalid calls to GraphNode#removeChild
4 participants