diff --git a/libnymea-gpio/gpiomonitor.cpp b/libnymea-gpio/gpiomonitor.cpp index b8dd7a4..e1ee24e 100644 --- a/libnymea-gpio/gpiomonitor.cpp +++ b/libnymea-gpio/gpiomonitor.cpp @@ -219,8 +219,12 @@ void GpioMonitor::run() } // Check if we should stop the thread - QMutexLocker stopLocker(&m_stopMutex); - if (m_stop) break; + m_stopMutex.lock(); + if (m_stop) { + m_stopMutex.unlock(); + break; + } + m_stopMutex.unlock(); // No interrupt occured if (rc == 0)