Skip to content

Commit

Permalink
Actually close the window then requested.
Browse files Browse the repository at this point in the history
  • Loading branch information
cabrownlie committed Jan 26, 2024
1 parent aa810fb commit 90f092b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn main() {
let mut app = App::new(window).await;

// Run the event loop
let _ = event_loop.run(|event, _elwt| match event {
let _ = event_loop.run(|event, elwt| match event {
Event::WindowEvent {
window_id: _,
event,
Expand All @@ -57,6 +57,9 @@ async fn main() {
// [window.request_redraw()] without the borrow checker complaining.
app.render();
}
WindowEvent::CloseRequested => {
elwt.exit();
}
_ => {}
},
_ => {}
Expand Down

0 comments on commit 90f092b

Please sign in to comment.