From 48d2e56e6963c6c35b9d75106dc3fd0b121b10b5 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:49:10 -0800 Subject: [PATCH] Cleanup some cache entries --- src/apply_mutations.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/apply_mutations.rs b/src/apply_mutations.rs index 95e5d64..1481c29 100644 --- a/src/apply_mutations.rs +++ b/src/apply_mutations.rs @@ -91,6 +91,8 @@ pub fn apply_mutations( let new = stack.drain((stack.len() - m)..).collect::>(); existing_parent.insert_children(existing_index, &new); DespawnRecursive { entity: existing }.apply(world); + let existing_element_id = bevy_ui_entity_to_element_id.remove(&existing).unwrap(); + element_id_to_bevy_ui_entity.remove(&existing_element_id); } Mutation::InsertAfter { id, m } => todo!(), Mutation::InsertBefore { id, m } => todo!(),