From ad78c23a2e16877f737be85ca2e533a083469848 Mon Sep 17 00:00:00 2001 From: MiniTurtle Date: Fri, 12 Apr 2024 19:53:27 +0300 Subject: [PATCH] fix log mutex --- src/log.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/log.cpp b/src/log.cpp index a0868a71e9b0..f403899a2786 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -280,7 +280,10 @@ void Logger::logToOutputs(LogLevel lev, const std::string &combined, const std::string &time, const std::string &thread_name, const std::string &payload_text) { - logOutputData.push_back({ lev, combined, time, thread_name, payload_text }); + { + MutexAutoLock lock(m_mutex); + logOutputData.push_back({ lev, combined, time, thread_name, payload_text }); + } flushLogToOutputs(); }