From a271a636027c1ff94ccd557758394f45174b5d75 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Wed, 11 Feb 2026 14:46:56 -0700 Subject: [PATCH] Fix crash: check joinable() before thread join in end_broadcast --- src/stream.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stream.cpp b/src/stream.cpp index e9a3bf9d..da3bb411 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -1823,13 +1823,13 @@ namespace stream { audio_packets.reset(); BOOST_LOG(debug) << "Waiting for main listening thread to end..."sv; - ctx.recv_thread.join(); + if (ctx.recv_thread.joinable()) ctx.recv_thread.join(); BOOST_LOG(debug) << "Waiting for main video thread to end..."sv; - ctx.video_thread.join(); + if (ctx.video_thread.joinable()) ctx.video_thread.join(); BOOST_LOG(debug) << "Waiting for main audio thread to end..."sv; - ctx.audio_thread.join(); + if (ctx.audio_thread.joinable()) ctx.audio_thread.join(); BOOST_LOG(debug) << "Waiting for main control thread to end..."sv; - ctx.control_thread.join(); + if (ctx.control_thread.joinable()) ctx.control_thread.join(); BOOST_LOG(debug) << "All broadcasting threads ended"sv; broadcast_shutdown_event->reset();