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 {