correctly setup everything in the default run_once runner (#8740)

# Objective

- Fix #8658 
- `without_winit` example panics `thread 'Compute Task Pool (2)'
panicked at 'called `Option::unwrap()` on a `None` value',
crates/bevy_render/src/pipelined_rendering.rs:134:84`

## Solution

- In the default runner method `run_once`, correctly finish the
initialisation of the plugins. `run_once` can't be called twice so it's
ok to do it there
This commit is contained in:
François 2023-06-05 22:54:12 +02:00 committed by GitHub
parent 3507b21dce
commit 4e25008dd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -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 }

View file

@ -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();
}