From 32b50811273ad9a33641348cea2406f99dcdf8f8 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sat, 3 Oct 2015 13:41:46 +0100 Subject: [PATCH] Fixed mutex lock mistakes. --- src/blackmisc/pixmap.cpp | 4 ++-- src/blackmisc/threadedreader.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blackmisc/pixmap.cpp b/src/blackmisc/pixmap.cpp index a4757ea95..54ea1ba37 100644 --- a/src/blackmisc/pixmap.cpp +++ b/src/blackmisc/pixmap.cpp @@ -32,7 +32,7 @@ namespace BlackMisc const QPixmap &CPixmap::pixmap() const { - QWriteLocker(&this->m_lock); + QWriteLocker lock(&this->m_lock); if (this->m_hasCachedPixmap) { return this->m_pixmap; } // this part here becomes relevant when marshalling via DBus is used @@ -47,7 +47,7 @@ namespace BlackMisc bool CPixmap::isNull() const { - QReadLocker(&this->m_lock); + QReadLocker lock(&this->m_lock); if (this->m_hasCachedPixmap) { return false; } return (this->m_array.isEmpty() || this->m_array.isNull()); } diff --git a/src/blackmisc/threadedreader.cpp b/src/blackmisc/threadedreader.cpp index 9524ff021..b0d28f93f 100644 --- a/src/blackmisc/threadedreader.cpp +++ b/src/blackmisc/threadedreader.cpp @@ -18,13 +18,13 @@ namespace BlackMisc QDateTime CThreadedReader::getUpdateTimestamp() const { - QReadLocker(&this->m_lock); + QReadLocker lock(&this->m_lock); return this->m_updateTimestamp; } void CThreadedReader::setUpdateTimestamp(const QDateTime &updateTimestamp) { - QWriteLocker(&this->m_lock); + QWriteLocker lock(&this->m_lock); this->m_updateTimestamp = updateTimestamp; }