diff options
author | 2021-11-29 14:57:40 +0700 | |
---|---|---|
committer | 2021-11-29 14:57:40 +0700 | |
commit | d9f970ffd5af6dafb5e696ad317d9ea7b997eb4b (patch) | |
tree | a86528163bf5830b227cc9c6383102b2543f5c64 /glutin | |
parent | 96c7f9765c716dbe94d25f4961d07bc8e18a02c4 (diff) | |
parent | 2f50d114612e0dc5cb23389ade2a21819836d254 (diff) | |
download | iced-d9f970ffd5af6dafb5e696ad317d9ea7b997eb4b.tar.gz iced-d9f970ffd5af6dafb5e696ad317d9ea7b997eb4b.tar.bz2 iced-d9f970ffd5af6dafb5e696ad317d9ea7b997eb4b.zip |
Merge pull request #1112 from AndiHofi/on_exit_callback
Application::run returns on native platforms
Diffstat (limited to 'glutin')
-rw-r--r-- | glutin/src/application.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/glutin/src/application.rs b/glutin/src/application.rs index 5d10e96a..a1165de3 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -28,12 +28,13 @@ where use futures::task; use futures::Future; use glutin::event_loop::EventLoop; + use glutin::platform::run_return::EventLoopExtRunReturn; use glutin::ContextBuilder; let mut debug = Debug::new(); debug.startup_started(); - let event_loop = EventLoop::with_user_event(); + let mut event_loop = EventLoop::with_user_event(); let mut proxy = event_loop.create_proxy(); let mut runtime = { @@ -115,7 +116,7 @@ where let mut context = task::Context::from_waker(task::noop_waker_ref()); - event_loop.run(move |event, _, control_flow| { + event_loop.run_return(move |event, _, control_flow| { use glutin::event_loop::ControlFlow; if let ControlFlow::Exit = control_flow { @@ -148,6 +149,8 @@ where }; } }); + + Ok(()) } async fn run_instance<A, E, C>( |