Rename LoopDestroyed to LoopExiting

Considering the possibility of re-running an event loop via run_ondemand
then it's more correct to say that the loop is about to exit without
assuming it's going to be destroyed.
This commit is contained in:
Robert Bragg 2023-07-28 17:19:53 +01:00 committed by GitHub
parent 755c533b08
commit 935146d299
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 28 additions and 30 deletions

View file

@ -341,7 +341,7 @@ impl<T: 'static> EventLoop<T> {
};
// We wait until we've checked for an exit status before clearing the
// application callback, in case we need to dispatch a LoopDestroyed event
// application callback, in case we need to dispatch a LoopExiting event
//
// # Safety
// This pairs up with our call to `runner.set_event_handler` and ensures

View file

@ -251,7 +251,7 @@ impl<T> EventLoopRunner<T> {
}
/// Dispatch control flow events (`NewEvents`, `MainEventsCleared`, `RedrawEventsCleared`, and
/// `LoopDestroyed`) as necessary to bring the internal `RunnerState` to the new runner state.
/// `LoopExiting`) as necessary to bring the internal `RunnerState` to the new runner state.
///
/// The state transitions are defined as follows:
///
@ -298,7 +298,7 @@ impl<T> EventLoopRunner<T> {
self.call_new_events(true);
self.call_event_handler(Event::MainEventsCleared);
self.call_redraw_events_cleared();
self.call_event_handler(Event::LoopDestroyed);
self.call_event_handler(Event::LoopExiting);
}
(_, Uninitialized) => panic!("cannot move state to Uninitialized"),
@ -307,7 +307,7 @@ impl<T> EventLoopRunner<T> {
self.call_new_events(false);
}
(Idle, Destroyed) => {
self.call_event_handler(Event::LoopDestroyed);
self.call_event_handler(Event::LoopExiting);
}
(HandlingMainEvents, Idle) => {
@ -317,7 +317,7 @@ impl<T> EventLoopRunner<T> {
(HandlingMainEvents, Destroyed) => {
self.call_event_handler(Event::MainEventsCleared);
self.call_redraw_events_cleared();
self.call_event_handler(Event::LoopDestroyed);
self.call_event_handler(Event::LoopExiting);
}
(Destroyed, _) => panic!("cannot move state from Destroyed"),