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
This commit is contained in:
parent
69ea0fb3ee
commit
f509d44cca
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user