From 585a01735ad66770fc59f8a810dca307fbdb5c43 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 1 Apr 2022 09:48:20 -0400 Subject: [PATCH] Fix lockups due to lack of locking around terminate_ --- src/zm_event.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zm_event.h b/src/zm_event.h index 637f62dc3..667528bab 100644 --- a/src/zm_event.h +++ b/src/zm_event.h @@ -145,7 +145,10 @@ class Event { void AddFrame(const std::shared_ptr&packet); void Stop() { - terminate_ = true; + { + std::unique_lock lck(packet_queue_mutex); + terminate_ = true; + } packet_queue_condition.notify_all(); } bool Stopped() const { return terminate_; }