aboutsummaryrefslogtreecommitdiff
path: root/src/QR-Code-scanner/QrScanThread.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2017-11-03 15:29:10 -0500
committerluigi1111 <luigi1111w@gmail.com>2017-11-03 15:29:10 -0500
commitc58dfa913bb356368e12dc5248c4f5acdfe3934d (patch)
treeb50d0010ac51fa44405bcaec573dab03236ff9cb /src/QR-Code-scanner/QrScanThread.cpp
parent6f95f8a7545bbdc25750412c54a92ddc5224b3ad (diff)
parentceeb9b667fa35f92054c79942b593337fadcd08b (diff)
downloadmonzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.tar.gz
monzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.tar.xz
monzero-gui-c58dfa913bb356368e12dc5248c4f5acdfe3934d.zip
Merge pull request #826
Remote nodes + mobile layout
Diffstat (limited to 'src/QR-Code-scanner/QrScanThread.cpp')
-rw-r--r--src/QR-Code-scanner/QrScanThread.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/QR-Code-scanner/QrScanThread.cpp b/src/QR-Code-scanner/QrScanThread.cpp
index b6e9b9ff..48ecb53a 100644
--- a/src/QR-Code-scanner/QrScanThread.cpp
+++ b/src/QR-Code-scanner/QrScanThread.cpp
@@ -110,6 +110,7 @@ void QrScanThread::processVideoFrame(const QVideoFrame &frame)
void QrScanThread::stop()
{
m_running = false;
+ m_waitCondition.wakeOne();
}
void QrScanThread::addFrame(const QVideoFrame &frame)
@@ -124,9 +125,10 @@ void QrScanThread::run()
QVideoFrame frame;
while(m_running) {
QMutexLocker locker(&m_mutex);
- while(m_queue.isEmpty())
+ while(m_queue.isEmpty() && m_running)
m_waitCondition.wait(&m_mutex);
- processVideoFrame(m_queue.takeFirst());
+ if(!m_queue.isEmpty())
+ processVideoFrame(m_queue.takeFirst());
}
}