From 5ea80b625764810a4b741041ae5dcbb6f5af3805 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 18 Apr 2015 12:17:54 +0200 Subject: Avoid error while processing messagequeue Only process while we have messages available. --- dummyresource/resourcefactory.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dummyresource') diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index 679bba2..d5765e2 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp @@ -176,6 +176,11 @@ private slots: //Async::foreach("pass iterator here").parallel("process value here").join(); return Async::dowhile( [this, queue](Async::Future &future) { + if (queue->isEmpty()) { + future.setValue(false); + future.setFinished(); + return; + } queue->dequeue( [this, &future](void *ptr, int size, std::function messageQueueCallback) { auto callback = [messageQueueCallback, &future](bool success) { -- cgit v1.2.3