Merge #15462: gui: Fix async open wallet call order

a720a983015c9ef8cc814c16a5b9ef6379695817 gui: Fix async open wallet call order (João Barbosa)

Pull request description:

  Fixes #15455. Must call `OpenWalletActivity::open` asynchronously only after all connections are made to the `OpenWalletActivity` instance, otherwise signals can be missed.

Tree-SHA512: 4e5fdbd09d2ca017ed07a1813c2707c09f96275f1498779804e322e0a4dbd7dcff0c2e9cd6ec18463cd427b88b192a8d02373de9edc2b03ba5e4b8484b264417
This commit is contained in:
Wladimir J. van der Laan 2019-02-27 11:28:31 +01:00 committed by pasta
parent eb95f83096
commit d90e81919f
2 changed files with 2 additions and 1 deletions

View File

@ -510,6 +510,8 @@ void BitcoinGUI::createActions()
connect(activity, &OpenWalletActivity::opened, this, &BitcoinGUI::setCurrentWallet);
connect(activity, &OpenWalletActivity::finished, activity, &QObject::deleteLater);
connect(activity, &OpenWalletActivity::finished, dialog, &QObject::deleteLater);
bool invoked = QMetaObject::invokeMethod(activity, "open");
assert(invoked);
});
}
});

View File

@ -60,7 +60,6 @@ OpenWalletActivity* WalletController::openWallet(const std::string& name, QWidge
{
OpenWalletActivity* activity = new OpenWalletActivity(this, name);
activity->moveToThread(&m_activity_thread);
QMetaObject::invokeMethod(activity, "open", Qt::QueuedConnection);
return activity;
}