Skip to content

Commit 90f092b

Browse files
committed
Actually close the window then requested.
1 parent aa810fb commit 90f092b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async fn main() {
3232
let mut app = App::new(window).await;
3333

3434
// Run the event loop
35-
let _ = event_loop.run(|event, _elwt| match event {
35+
let _ = event_loop.run(|event, elwt| match event {
3636
Event::WindowEvent {
3737
window_id: _,
3838
event,
@@ -57,6 +57,9 @@ async fn main() {
5757
// [window.request_redraw()] without the borrow checker complaining.
5858
app.render();
5959
}
60+
WindowEvent::CloseRequested => {
61+
elwt.exit();
62+
}
6063
_ => {}
6164
},
6265
_ => {}

0 commit comments

Comments
 (0)