diff --git a/include/spdlog/details/backtracer.h b/include/spdlog/details/backtracer.h index e09c6128..a68d32b4 100644 --- a/include/spdlog/details/backtracer.h +++ b/include/spdlog/details/backtracer.h @@ -39,6 +39,7 @@ public: // pop all items in the q and apply the give fun on each of them. void foreach_pop(std::function fun) { + std::lock_guard lock{mutex_}; while (!messages_.empty()) { log_msg_buffer popped;