From d8def332bfa1a419e1aed7a3e8fb258240c72a22 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Wed, 18 Sep 2024 14:24:47 -0700 Subject: [PATCH] fixed issue causing it not to exit on disconnect Signed-off-by: Nickiel12 --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7580f2d..275d59b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -259,6 +259,7 @@ async fn main() { } }; } + info!("Closing send_rtp messages thread"); }); info!("starting webrtc connection kickoff"); @@ -287,12 +288,16 @@ async fn main() { info!("Event Loop cancelled flag caught"); break; } - Ok(msg) = app_receiver.recv() => { + val = app_receiver.recv() => { + if val.is_err() { + break; + } + if to_quit.load(Ordering::SeqCst) { info!("ToQuit set, breaking app_receiver set"); break; } - match msg { + match val.unwrap() { ApplicationMessage::ConnectionSupportsWebRTC(_) => {}, ApplicationMessage::ConnectionSupportsWebRTCRequest => { if let Err(e) = app_sender.send(ApplicationMessage::ConnectionSupportsWebRTC(do_webrtc)).await {