Skip to content

Commit 66a90d7

Browse files
committed
Run main schedule at least once to ensure Startup et al run.
1 parent be49db5 commit 66a90d7

File tree

1 file changed

+8
-0
lines changed
  • crates/processing_render/src

1 file changed

+8
-0
lines changed

crates/processing_render/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,15 @@ pub fn init(config: Config) -> error::Result<()> {
312312
}
313313

314314
let mut app = create_app(config);
315+
// contrary to what the following methods might imply, this is just finishing plugin setup
316+
// which normally happens in the app runner (i.e. in a "normal" bevy app), but since we don't
317+
// have one we need to do it manually here
315318
app.finish();
316319
app.cleanup();
320+
// also, we need to run the main schedule once to ensure all systems are initialized before we
321+
// return from init, to ensure any plugins that need to do setup in their first update can rely
322+
// on that
323+
app.main_mut().run_default_schedule();
317324
set_app(app);
318325

319326
Ok(())
@@ -346,6 +353,7 @@ pub async fn init(config: Config) -> error::Result<()> {
346353

347354
app.finish();
348355
app.cleanup();
356+
app.main_mut().run_default_schedule();
349357
set_app(app);
350358

351359
Ok(())

0 commit comments

Comments
 (0)