diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 47aa4ed7d..a3ecb1fb8 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -126,7 +126,11 @@ VBestSquare VPosition::ArrangeDetail(const VPositionData &data, std::atomic_bool QScopedPointer thread_pool(new QThreadPool()); QVector threads; - auto Cleanup = qScopeGuard([threads] {qDeleteAll(threads.begin(), threads.end());}); + auto Cleanup = qScopeGuard([&threads] + { + Q_ASSERT(not threads.isEmpty()); + qDeleteAll(threads.begin(), threads.end()); + }); for (int j=1; j <= data.gContour.GlobalEdgesCount(); ++j) { @@ -145,6 +149,8 @@ VBestSquare VPosition::ArrangeDetail(const VPositionData &data, std::atomic_bool } } + Q_ASSERT(not threads.isEmpty()); + // Wait for done do {