From f509d44ccabe6550ceb2ee6164fbbb0993888b4c Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Tue, 18 Jul 2017 22:03:37 +0200 Subject: [PATCH] Use a mutex locker. I am currently working on another private project and that and the lack of the ability to reproduce some issues is why the development has slowed down --- worker/worker.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/worker/worker.cpp b/worker/worker.cpp index 457bdb6..ec317cf 100644 --- a/worker/worker.cpp +++ b/worker/worker.cpp @@ -58,14 +58,13 @@ bool Worker::ended() { void Worker::process() { while (!ended()) { - lock.lock(); + QMutexLocker ml(&lock); if (!qqueue.isEmpty()) { _WorkerContext *c = qqueue.dequeue(); c->consumer(c->image.convertToFormat(c->targetFormat)); delete c->underlyingThing; delete c; } - lock.unlock(); std::this_thread::sleep_for(std::chrono::milliseconds(10)); // STL likes it's scopes } emit finished();