Fix memory leak.
--HG-- branch : develop
This commit is contained in:
parent
0d7c406df4
commit
a986f765a6
|
@ -126,7 +126,11 @@ VBestSquare VPosition::ArrangeDetail(const VPositionData &data, std::atomic_bool
|
||||||
QScopedPointer<QThreadPool> thread_pool(new QThreadPool());
|
QScopedPointer<QThreadPool> thread_pool(new QThreadPool());
|
||||||
QVector<VPosition *> threads;
|
QVector<VPosition *> 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)
|
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
|
// Wait for done
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user