Skip to content

Commit bb6ab1b

Browse files
committed
Fix unreachable panic after setting ControlFlow to Poll during some RedrawRequested events.
1 parent 5068ff4 commit bb6ab1b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/platform_impl/windows/event_loop.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ impl<T> EventLoopRunner<T> {
400400
};
401401
self.call_event_handler(Event::NewEvents(start_cause));
402402
},
403-
ControlFlow::Poll |
403+
// This can be reached if the control flow is changed to poll during a `RedrawRequested`
404+
// that was sent after `EventsCleared`.
405+
ControlFlow::Poll => self.call_event_handler(Event::NewEvents(StartCause::Poll)),
404406
ControlFlow::Exit => unreachable!()
405407
}
406408
}

0 commit comments

Comments
 (0)