bevy/crates/bevy_scene/src
Manuel Brea Carreras 3902804114
Fix #19219 by moving observer triggers out of resource_scope (#19221)
# Objective

Fixes #19219 

## Solution

Instead of calling `world.commands().trigger` and
`world.commands().trigger_targets` whenever each scene is spawned, save
the `instance_id` and optional parent entity to perform all such calls
at the end. This prevents the potential flush of the world command queue
that can happen if `add_child` is called from causing the crash.

## Testing

- Did you test these changes? If so, how?
- Verified that I can no longer reproduce the bug with the instructions
at #19219.
  - Ran `bevy_scene` tests
- Visually verified that the following examples still run as expected
`many_foxes`, `scene` . (should I test any more?)
- Are there any parts that need more testing?
- Pending to run `cargo test` at the root to test that all examples
still build; I will update the PR when that's done
- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
  - Run bevy as usual
- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
  - N/a (tested on Linux/wayland but it shouldn't be relevant)

---
2025-05-30 19:33:47 +00:00
..
components.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
dynamic_scene_builder.rs Make entity::index non max (#18704) 2025-05-07 18:20:30 +00:00
dynamic_scene.rs Switch ChildOf back to tuple struct (#18672) 2025-04-02 00:10:10 +00:00
lib.rs Properly gate imports in bevy_scene (#18482) 2025-03-22 12:22:20 +00:00
reflect_utils.rs
scene_filter.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
scene_loader.rs Properly gate imports in bevy_scene (#18482) 2025-03-22 12:22:20 +00:00
scene_spawner.rs Fix #19219 by moving observer triggers out of resource_scope (#19221) 2025-05-30 19:33:47 +00:00
scene.rs reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
serde.rs Make entity generation a new type and remove identifier (#19121) 2025-05-08 04:03:05 +00:00