From fd1d6a388d551da1dadd393d18776477093d832a Mon Sep 17 00:00:00 2001 From: memoryruins Date: Sun, 20 Sep 2020 19:32:07 -0400 Subject: [PATCH] Stop looping when scheduler receives an AppExit (#536) --- crates/bevy_app/src/schedule_runner.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/bevy_app/src/schedule_runner.rs b/crates/bevy_app/src/schedule_runner.rs index e8b4f7493c..b14e43eed6 100644 --- a/crates/bevy_app/src/schedule_runner.rs +++ b/crates/bevy_app/src/schedule_runner.rs @@ -94,10 +94,8 @@ impl Plugin for ScheduleRunnerPlugin { #[cfg(not(target_arch = "wasm32"))] { - loop { - if let Some(delay) = tick(&mut app, wait) { - thread::sleep(delay); - } + while let Some(delay) = tick(&mut app, wait) { + thread::sleep(delay); } }