Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't Panic #651

Merged
merged 5 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
- This allows drop-in use of colors from most applications.
- New methods `Color::rgb_linear` and `Color::rgba_linear` will accept colors already in linear sRGB (the old behavior)
- Individual color-components must now be accessed through setters and getters: `.r`, `.g`, `.b`, `.a`, `.set_r`, `.set_g`, `.set_b`, `.set_a`, and the corresponding methods with the `*_linear` suffix.
- Despawning an entity multiple times causes a debug-level log message to be emitted instead of a panic [649]
- Despawning an entity multiple times causes a debug-level log message to be emitted instead of a panic [649] [651]


[552]: https://github.com/bevyengine/bevy/pull/552
[616]: https://github.com/bevyengine/bevy/pull/616
[649]: https://github.com/bevyengine/bevy/pull/649
[651]: https://github.com/bevyengine/bevy/pull/651


## Version 0.2.1 (2020-9-20)

Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_transform/src/hierarchy/hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ fn despawn_with_children_recursive_inner(world: &mut World, entity: Entity) {
}
}

world.despawn(entity).unwrap();
if let Err(e) = world.despawn(entity) {
log::debug!("Failed to despawn entity {:?}: {}", entity, e);
}
}

impl WorldWriter for DespawnRecursive {
Expand Down Expand Up @@ -128,6 +130,7 @@ mod tests {
let parent_entity = world.get::<Children>(grandparent_entity).unwrap()[0];

command_buffer.despawn_recursive(parent_entity);
command_buffer.despawn_recursive(parent_entity); // despawning the same entity twice should not panic
command_buffer.apply(&mut world, &mut resources);

let results = world
Expand Down