forked from qt-creator/qt-creator
Do QFutureWatcher::setFuture() after connecting to watcher's signals
Otherwise we may have race condition. Reference: documentation for QFutureWatcher::setFuture() and the implementation of QFutureInterfaceBasePrivate::connectOutputInterface( QFutureCallOutInterface *interface). Change-Id: I5b483baaf1b844871a162f47ce7683e9ff495acb Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -190,9 +190,9 @@ public:
|
||||
command->addFlags(VcsCommand::SilentOutput | VcsCommand::SuppressFailMessage);
|
||||
command->setProgressiveOutput(true);
|
||||
QFutureWatcher<FileSearchResultList> watcher;
|
||||
watcher.setFuture(m_fi.future());
|
||||
connect(&watcher, &QFutureWatcher<FileSearchResultList>::canceled,
|
||||
command.data(), &VcsCommand::cancel);
|
||||
watcher.setFuture(m_fi.future());
|
||||
connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read);
|
||||
SynchronousProcessResponse resp = command->runCommand({GitClient::instance()->vcsBinary(), arguments}, 0);
|
||||
switch (resp.result) {
|
||||
|
||||
Reference in New Issue
Block a user