Repository navigation
#2384 Fix deleting a parent before its Parent-component children - #2385
Open
andrewgazelka wants to merge 2 commits into
Open
andrewgazelka wants to merge 2 commits into
andrewgazelka wants to merge 2 commits into
Conversation
…ponent children When a delete clears the table of a parent before the ChildOf record of the parent deletes its children, the children were deleted with a dead parent (assert in flecs_non_fragmenting_childof_move), or leaked if the parent had OrderedChildren (flecs_ordered_children_clear dropped the flag of the marked record, so cleanup skipped the children).
… parent being deleted The check walks the parents of the parent with ecs_get_parent, which asserts when one of them was already deleted in the same delete.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2384.
When a delete clears the table of a parent before the parent's
(ChildOf, p)entry deletes itsParent-component children:flecs_non_fragmenting_childof_moveaccepts a dead parent if its(ChildOf, p)record is marked for delete (it stays alive until the delete finishes). For such records it skips the prefab spawner check. That check walks the parent's own parents withecs_get_parent, which asserts if one of them is already gone.flecs_ordered_children_clearkeepsEcsIdOrderedChildrenon a record that is marked for delete and still hasParentchildren, soflecs_on_delete_clear_entitiesstill finds and deletes them (it already kept the vector).Tests (all fail on master):
NonFragmentingChildOf.delete_parent_w_table_cleared_before_children,delete_parent_w_ordered_children_w_table_cleared_before_childrenanddelete_parent_w_prefab_child_w_table_cleared_before_children. core, query, addons, meta, script and collections pass on macOS arm64. The script from the issue now exits cleanly.distr/flecs_no_addons.*on master were already out of date withsrc. Only this change is applied to them.