Fix Windows backend invoking unreachable! with Exit and run_return (#887)

This commit is contained in:
Osspial 2019-05-27 13:45:26 -04:00 committed by GitHub
parent 3a7350cbb9
commit 76660f3621
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -380,6 +380,7 @@ impl<T> EventLoopRunner<T> {
// deferred.
if let RunnerState::DeferredNewEvents(wait_start) = self.runner_state {
match self.control_flow {
ControlFlow::Exit |
ControlFlow::Wait => {
self.call_event_handler(
Event::NewEvents(StartCause::WaitCancelled {
@ -409,7 +410,6 @@ impl<T> EventLoopRunner<T> {
ControlFlow::Poll => {
self.call_event_handler(Event::NewEvents(StartCause::Poll))
},
ControlFlow::Exit => unreachable!()
}
}