forked from qt-creator/qt-creator
Tracing: Only call QFutureWatcher::setFuture() after connecting to it
Fixes: QTCREATORBUG-21485 Change-Id: Icc44cf0195775d31934a60cb064addc94b152d92 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -283,7 +283,6 @@ QFuture<void> TimelineTraceManager::load(const QString &filename)
|
||||
});
|
||||
|
||||
QFutureWatcher<void> *watcher = new QFutureWatcher<void>(reader);
|
||||
watcher->setFuture(future);
|
||||
connect(watcher, &QFutureWatcherBase::canceled, this, &TimelineTraceManager::clearAll);
|
||||
connect(watcher, &QFutureWatcherBase::finished, this, [this, reader]() {
|
||||
if (!reader->isCanceled()) {
|
||||
@@ -294,6 +293,7 @@ QFuture<void> TimelineTraceManager::load(const QString &filename)
|
||||
finalize();
|
||||
}
|
||||
});
|
||||
watcher->setFuture(future);
|
||||
|
||||
return future;
|
||||
}
|
||||
|
Reference in New Issue
Block a user