mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-17 16:28:14 +00:00
FutureScheduler: fix possible race, connect before setFuture
This commit is contained in:
parent
3d7ded209a
commit
3ea329e45f
1 changed files with 1 additions and 1 deletions
|
@ -50,10 +50,10 @@ private:
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto *watcher = newWatcher<T>();
|
auto *watcher = newWatcher<T>();
|
||||||
watcher->setFuture(makeFuture(watcher));
|
|
||||||
connect(watcher, &QFutureWatcher<T>::finished, [this, watcher] {
|
connect(watcher, &QFutureWatcher<T>::finished, [this, watcher] {
|
||||||
watcher->deleteLater();
|
watcher->deleteLater();
|
||||||
});
|
});
|
||||||
|
watcher->setFuture(makeFuture(watcher));
|
||||||
return qMakePair(true, watcher->future());
|
return qMakePair(true, watcher->future());
|
||||||
}
|
}
|
||||||
catch (const std::exception &exception)
|
catch (const std::exception &exception)
|
||||||
|
|
Loading…
Reference in a new issue