From 6a027cb2d982c385859150ad1558a1e205817844 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 14 Nov 2015 13:55:34 +0100 Subject: [PATCH] Fix a crash during shutdown. --- bmusb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bmusb.cpp b/bmusb.cpp index 0582b99..7e0864e 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -159,6 +159,8 @@ void BMUSBCapture::dequeue_thread_func() unique_lock lock(queue_lock); queues_not_empty.wait(lock, [this]{ return dequeue_thread_should_quit || (!pending_video_frames.empty() && !pending_audio_frames.empty()); }); + if (dequeue_thread_should_quit) break; + uint16_t video_timecode = pending_video_frames.front().timecode; uint16_t audio_timecode = pending_audio_frames.front().timecode; if (uint16_less_than_with_wraparound(video_timecode, audio_timecode)) { -- 2.39.2