gui: disable top bar menu actions during shutdown

Opening the top bar menu when the app is being destroyed
freezes the GUI shutdown process for no reason. No menu
action can be executed.

Note:
This behavior is consistent with how the tray icon menu
is cleared too.
This commit is contained in:
furszy
2023-10-13 17:27:24 -03:00
parent 7066e8996d
commit 8b6470a906

View File

@@ -650,6 +650,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
m_mask_values_action->setChecked(_clientModel->getOptionsModel()->getOption(OptionsModel::OptionID::MaskValues).toBool());
} else {
// Shutdown requested, disable menus
if (trayIconMenu)
{
// Disable context menu on tray icon
@@ -664,6 +665,8 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
}
#endif // ENABLE_WALLET
unitDisplayControl->setOptionsModel(nullptr);
// Disable top bar menu actions
appMenuBar->clear();
}
}