mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 06:30:19 +00:00
092bb71bcf
# Objective Clean up taffy nodes when the associated UI node gets removed. The current UI code will keep the taffy nodes around forever. ## Solution Use `RemovedComponents<Node>` to iterate over nodes that are no longer valid UI nodes or that have been despawned, and remove them from taffy and the internal hash map. ## Implementation Notes Do note that using `despawn()` instead of `despawn_recursive()` on a UI node that has children will result in a [warnings spam](https://github.com/bevyengine/bevy/blob/main/crates/bevy_ui/src/flex/mod.rs#L120) since the children will not be part of a proper UI hierarchy anymore. --- ## Changelog - Fixed memory leak when nodes are removed in bevy_ui |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |