Skip to content

Commit

Permalink
move the clear_entities to the top of the loop
Browse files Browse the repository at this point in the history
to guarantee nothing else can happen inbetween
  • Loading branch information
TheRawMeatball committed Aug 1, 2022
1 parent dcaefaf commit 038f2a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ impl Plugin for RenderPlugin {
app.add_sub_app(RenderApp, render_app, move |app_world, render_app| {
#[cfg(feature = "trace")]
let _render_span = bevy_utils::tracing::info_span!("renderer subapp").entered();
{
#[cfg(feature = "trace")]
let _stage_span =
bevy_utils::tracing::info_span!("stage", name = "clear_entities").entered();

render_app.world.clear_entities();
}
{
#[cfg(feature = "trace")]
let _stage_span =
Expand Down Expand Up @@ -305,13 +312,6 @@ impl Plugin for RenderPlugin {
.unwrap();
cleanup.run(&mut render_app.world);
}
{
#[cfg(feature = "trace")]
let _stage_span =
bevy_utils::tracing::info_span!("stage", name = "clear_entities").entered();

render_app.world.clear_entities();
}
});
}

Expand Down

0 comments on commit 038f2a5

Please sign in to comment.