Exit runtime with control_sender instead of break

This commit is contained in:
Héctor Ramón Jiménez 2024-07-24 10:34:24 +02:00
parent faa5d0c58d
commit 2eea9b81e4
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F

View file

@ -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,
@ -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)) =