bevy/crates
Josh Robson Chase 3d0f2409d5
bevy_ecs: flush entities after running observers and hooks in despawn (#15398)
# Objective

Fixes #14467

Observers and component lifecycle hooks are allowed to perform
operations that subsequently require `Entities` to be flushed, such as
reserving a new entity. If this occurs during an `on_remove` hook or an
`OnRemove` event trigger during an `EntityWorldMut::despawn`, a panic
will occur.

## Solution

Call `world.flush_entities()` after running `on_remove` hooks/observers
during `despawn`

## Testing

Added a new test that fails before the fix and succeeds afterward.
2024-09-24 01:08:10 +00:00
..
bevy_a11y Reflected traits for resources and components: bevy_a11y (#15192) 2024-09-14 01:43:16 +00:00
bevy_animation Allow animation clips to animate arbitrary properties. (#15282) 2024-09-23 17:14:12 +00:00
bevy_app Support systems that take references as input (#15184) 2024-09-23 17:37:29 +00:00
bevy_asset bevy_reflect: Replace "value" terminology with "opaque" (#15240) 2024-09-23 18:04:57 +00:00
bevy_audio Reflect derived traits on all components and resources: bevy_audio (#15211) 2024-09-15 14:24:00 +00:00
bevy_color Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +00:00
bevy_core Unify crate-level preludes (#15080) 2024-09-08 17:10:57 +00:00
bevy_core_pipeline Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_derive Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_dev_tools Added HeadlessPlugins (#15203) (#15260) 2024-09-19 16:44:43 +00:00
bevy_diagnostic Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_dylib Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_ecs bevy_ecs: flush entities after running observers and hooks in despawn (#15398) 2024-09-24 01:08:10 +00:00
bevy_encase_derive Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +00:00
bevy_gilrs Update gilrs requirement from 0.10.1 to 0.11.0 (#15245) 2024-09-16 23:34:04 +00:00
bevy_gizmos Reduce runtime panics through SystemParam validation (#15276) 2024-09-23 16:54:21 +00:00
bevy_gltf Allow animation clips to animate arbitrary properties. (#15282) 2024-09-23 17:14:12 +00:00
bevy_hierarchy Bubbling observers traversal should use query data (#15385) 2024-09-23 18:08:36 +00:00
bevy_input Use of deprecated function in example for ButtonInput (#15221) 2024-09-15 15:22:39 +00:00
bevy_internal Initial implementation of the Bevy Remote Protocol (Adopted) (#14880) 2024-09-23 18:36:16 +00:00
bevy_log Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_macro_utils Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_math Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +00:00
bevy_mikktspace Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +00:00
bevy_pbr Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_picking Bubbling observers traversal should use query data (#15385) 2024-09-23 18:08:36 +00:00
bevy_ptr Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_reflect bevy_reflect: Update EulerRot to match glam 0.29 (#15402) 2024-09-23 22:50:12 +00:00
bevy_remote Initial implementation of the Bevy Remote Protocol (Adopted) (#14880) 2024-09-23 18:36:16 +00:00
bevy_render Visibility range takes the model aabb into acount (#15164) 2024-09-23 20:38:26 +00:00
bevy_scene Rename push children to add children (#15196) 2024-09-16 23:16:04 +00:00
bevy_sprite feature gate picking backends (#15369) 2024-09-22 19:35:15 +00:00
bevy_state Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_tasks Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_text Zero fontsize panic workaround (#15371) 2024-09-23 17:31:50 +00:00
bevy_time Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_transform Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_ui Add the ability to control font smoothing (#15368) 2024-09-23 17:28:25 +00:00
bevy_utils move ShortName to bevy_reflect (#15340) 2024-09-21 20:52:46 +00:00
bevy_window Allow to expect (adopted) (#15301) 2024-09-20 19:16:42 +00:00
bevy_winit Log monitor and window information at startup in bevy_winit (#15377) 2024-09-23 17:36:16 +00:00