Skip to content

Commit 91f2b51

Browse files
committed
Document that AppExit can be read by Bevy apps (#4587)
Explain it's safe to subscribe to this event to detect an exit before it happens. For instance, to clean-up and release system resources.
1 parent 4bcb310 commit 91f2b51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/bevy_app/src/app.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,11 @@ fn run_once(mut app: App) {
920920
app.update();
921921
}
922922

923-
/// An event that indicates the [`App`] should exit. This will fully exit the app process.
923+
/// An event that indicates the [`App`] should exit. This will fully exit the app process at the
924+
/// start of the next tick of the schedule.
925+
///
926+
/// You can also use this event to detect that an exit was requested. In order to receive it, systems
927+
/// subscribing to this event should run after it was emitted and before the schedule of the same
928+
/// frame is over.
924929
#[derive(Debug, Clone, Default)]
925930
pub struct AppExit;

0 commit comments

Comments
 (0)