forked from qt-creator/qt-creator
Docker: Set future after connecting
Fixes a "QFutureWatcher::connect: connecting after calling setFuture()
is likely to produce race".
Amends 2a7bf0fdaf
.
Change-Id: I69391984e2e583491bb978e41812b4f5a4c7b1a6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -602,7 +602,6 @@ DockerDevice::DockerDevice()
|
|||||||
auto future = DockerApi::instance()->networks();
|
auto future = DockerApi::instance()->networks();
|
||||||
|
|
||||||
auto watcher = new QFutureWatcher<expected_str<QList<Network>>>(this);
|
auto watcher = new QFutureWatcher<expected_str<QList<Network>>>(this);
|
||||||
watcher->setFuture(future);
|
|
||||||
QObject::connect(watcher,
|
QObject::connect(watcher,
|
||||||
&QFutureWatcher<expected_str<QList<Network>>>::finished,
|
&QFutureWatcher<expected_str<QList<Network>>>::finished,
|
||||||
this,
|
this,
|
||||||
@@ -622,6 +621,7 @@ DockerDevice::DockerDevice()
|
|||||||
cb({errorItem});
|
cb({errorItem});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
watcher->setFuture(future);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(DockerApi::instance(),
|
connect(DockerApi::instance(),
|
||||||
|
Reference in New Issue
Block a user