qt: Assert QMetaObject::invokeMethod result

This commit is contained in:
João Barbosa
2019-07-06 17:16:01 +01:00
parent f27bd96b5f
commit 64fee48944
7 changed files with 44 additions and 22 deletions

View File

@@ -124,7 +124,8 @@ WalletModel* WalletController::getOrCreateWallet(std::unique_ptr<interfaces::Wal
} else {
// Handler callback runs in a different thread so fix wallet model thread affinity.
wallet_model->moveToThread(thread());
QMetaObject::invokeMethod(this, "addWallet", Qt::QueuedConnection, Q_ARG(WalletModel*, wallet_model));
bool invoked = QMetaObject::invokeMethod(this, "addWallet", Qt::QueuedConnection, Q_ARG(WalletModel*, wallet_model));
assert(invoked);
}
return wallet_model;