Skip to content

Commit

Permalink
Fix unreachable panic after setting ControlFlow to Poll during some R…
Browse files Browse the repository at this point in the history
…edrawRequested events.
  • Loading branch information
Osspial committed Nov 9, 2018
1 parent 5068ff4 commit bb6ab1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
}
}
Expand Down

0 comments on commit bb6ab1b

Please sign in to comment.