Skip to content

Commit

Permalink
Exit runtime with control_sender instead of break
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jul 24, 2024
1 parent faa5d0c commit 2eea9b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ async fn run_instance<P, C>(

debug.startup_finished();

'main: while let Some(event) = event_receiver.next().await {
while let Some(event) = event_receiver.next().await {
match event {
Event::WindowCreated {
id,
Expand Down Expand Up @@ -929,7 +929,11 @@ async fn run_instance<P, C>(
&& window_id != boot_window
&& window_manager.is_empty()
{
break 'main;
control_sender
.start_send(Control::Exit)
.expect("Send control action");

continue;
}

let Some((id, window)) =
Expand Down

0 comments on commit 2eea9b8

Please sign in to comment.