From 36f29a933fa82de18388813cf6f45ee0dbd8eb89 Mon Sep 17 00:00:00 2001 From: Pixelstorm Date: Mon, 28 Aug 2023 18:13:02 +0100 Subject: [PATCH] Remove redundant check for `AppExit` events in `ScheduleRunnerPlugin` (#9421) # Objective Fixes #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`. --- crates/bevy_app/src/schedule_runner.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/crates/bevy_app/src/schedule_runner.rs b/crates/bevy_app/src/schedule_runner.rs index d303769f92696..b8f45d87802f0 100644 --- a/crates/bevy_app/src/schedule_runner.rs +++ b/crates/bevy_app/src/schedule_runner.rs @@ -89,15 +89,6 @@ impl Plugin for ScheduleRunnerPlugin { -> Result, AppExit> { let start_time = Instant::now(); - if let Some(app_exit_events) = - app.world.get_resource_mut::>() - { - 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) =