Cpp: Fix leaks in ClangCodeModel tests

Change-Id: I19d4dc445d82fd24361f1eb752d9f35ccadd3efb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-19 10:17:21 +02:00
parent ae2cc246c3
commit b9413bcec7
2 changed files with 7 additions and 5 deletions

View File

@@ -975,7 +975,7 @@ void CppModelManager::watchForCanceledProjectIndexer(const QVector<QFuture<void>
if (future.isCanceled() || future.isFinished())
continue;
auto watcher = new QFutureWatcher<void>();
auto watcher = new QFutureWatcher<void>(this);
connect(watcher, &QFutureWatcher<void>::canceled, this, [this, project, watcher]() {
if (d->m_projectToIndexerCanceled.contains(project)) // Project not yet removed
d->m_projectToIndexerCanceled.insert(project, true);