diff --git a/src/util/ThreadPool.hpp b/src/util/ThreadPool.hpp index 90b7aad14..4369d2856 100644 --- a/src/util/ThreadPool.hpp +++ b/src/util/ThreadPool.hpp @@ -219,7 +219,7 @@ namespace util { } } - if (onComplete && busyWorkers == 0) { + if (onComplete && busyWorkers == 0 && results.empty()) { std::lock_guard jobsLock(jobsMutex); if (jobs.empty()) { onComplete();