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

@@ -1375,12 +1375,13 @@ static bool ThreadSafeMessageBox(BitcoinGUI* gui, const std::string& message, co
style &= ~CClientUIInterface::SECURE;
bool ret = false;
// In case of modal message, use blocking connection to wait for user to click a button
QMetaObject::invokeMethod(gui, "message",
bool invoked = QMetaObject::invokeMethod(gui, "message",
modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(caption)),
Q_ARG(QString, QString::fromStdString(message)),
Q_ARG(unsigned int, style),
Q_ARG(bool*, &ret));
assert(invoked);
return ret;
}