Skip to content

Commit

Permalink
Remove redundant check for AppExit events in ScheduleRunnerPlugin (
Browse files Browse the repository at this point in the history
…bevyengine#9421)

# Objective

Fixes bevyengine#9420

## Solution

Remove one of the two `AppExit` event checks in the
`ScheduleRunnerPlugin`'s main loop. Specificially, the check that
happens immediately before calling `App.update()`, to be consistent with
the `WinitPlugin`.
  • Loading branch information
BigWingBeat authored and Ray Redondo committed Jan 9, 2024
1 parent 09c2627 commit 9f49109
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions crates/bevy_app/src/schedule_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,6 @@ impl Plugin for ScheduleRunnerPlugin {
-> Result<Option<Duration>, AppExit> {
let start_time = Instant::now();

if let Some(app_exit_events) =
app.world.get_resource_mut::<Events<AppExit>>()
{
if let Some(exit) = app_exit_event_reader.iter(&app_exit_events).last()
{
return Err(exit.clone());
}
}

app.update();

if let Some(app_exit_events) =
Expand Down

0 comments on commit 9f49109

Please sign in to comment.