diff --git a/crates/bevy_app/Cargo.toml b/crates/bevy_app/Cargo.toml index 2a3f604e7b05f..89eec840c98e4 100644 --- a/crates/bevy_app/Cargo.toml +++ b/crates/bevy_app/Cargo.toml @@ -20,6 +20,7 @@ bevy_derive = { path = "../bevy_derive", version = "0.11.0-dev" } bevy_ecs = { path = "../bevy_ecs", version = "0.11.0-dev", default-features = false } bevy_reflect = { path = "../bevy_reflect", version = "0.11.0-dev", optional = true } bevy_utils = { path = "../bevy_utils", version = "0.11.0-dev" } +bevy_tasks = { path = "../bevy_tasks", version = "0.11.0-dev" } # other serde = { version = "1.0", features = ["derive"], optional = true } diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 613c5063df803..4a2c1eb58dc69 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -956,6 +956,13 @@ impl App { } fn run_once(mut app: App) { + while !app.ready() { + #[cfg(not(target_arch = "wasm32"))] + bevy_tasks::tick_global_task_pools_on_main_thread(); + } + app.finish(); + app.cleanup(); + app.update(); }