diff --git a/src/zm_db.cpp b/src/zm_db.cpp index 7db61e157..b5ec9d514 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -237,8 +237,12 @@ zmDbQueue::~zmDbQueue() { } void zmDbQueue::stop() { - mTerminate = true; + { + std::unique_lock lock(mMutex); + mTerminate = true; + } mCondition.notify_all(); + if (mThread.joinable()) mThread.join(); }