X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Flogging.cpp;h=ab0594c342e5b58a0d7bf63ec91693640adbba50;hp=49b7d5828359962dcc0f4fbdc274865c783c826d;hb=5c48ce328b0b049d0ddc1b137f20118c9084c929;hpb=b51310723cafcb7ab805ed528eb29fb4402d6d43 diff --git a/pv/logging.cpp b/pv/logging.cpp index 49b7d582..ab0594c3 100644 --- a/pv/logging.cpp +++ b/pv/logging.cpp @@ -28,6 +28,8 @@ #include +using std::lock_guard; + namespace pv { Logging logging; @@ -84,6 +86,8 @@ QString Logging::get_log() const void Logging::log(const QString &text, int source) { + lock_guard log_lock(log_mutex_); + if (buffer_.size() >= buffer_size_) buffer_.removeFirst();