mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-17 16:28:14 +00:00
Merge pull request #2630
3ea329e
FutureScheduler: fix possible race, connect before setFuture (xiphon)
This commit is contained in:
commit
3984f8d1e8
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