Fix actually exiting on frame output exit
@@ -152,7 +152,7 @@ impl Window {
let frame_output = callback(frame_input);
if frame_output.exit {
*control_flow = ControlFlow::Exit;
- }
+ } else {
if frame_output.swap_buffers {
windowed_context.swap_buffers().unwrap();
}
@@ -162,6 +162,7 @@ impl Window {
*control_flow = ControlFlow::Poll;
windowed_context.window().request_redraw();
}
+ }
if let Some(ref path) = frame_output.screenshot {
let pixels = crate::Screen::read_color(
&context,
