Fix unreachable panic after setting ControlFlow to Poll during some RedrawRequested events.

This commit is contained in:
Osspial
2018-09-09 14:28:16 -04:00
parent 5068ff4ee1
commit bb6ab1bb6e

View File

@@ -400,7 +400,9 @@ impl<T> EventLoopRunner<T> {
};
self.call_event_handler(Event::NewEvents(start_cause));
},
ControlFlow::Poll |
// This can be reached if the control flow is changed to poll during a `RedrawRequested`
// that was sent after `EventsCleared`.
ControlFlow::Poll => self.call_event_handler(Event::NewEvents(StartCause::Poll)),
ControlFlow::Exit => unreachable!()
}
}