Skip to content

Commit ae0ca10

Browse files
committed
merge bitcoin-core/gui#751: macOS, do not process actions during shutdown
1 parent 107a180 commit ae0ca10

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/qt/bitcoingui.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ BitcoinGUI::~BitcoinGUI()
263263
trayIcon->hide();
264264
#ifdef Q_OS_MAC
265265
delete m_app_nap_inhibitor;
266-
delete appMenuBar;
267266
MacDockIconHandler::cleanup();
268267
#endif
269268

@@ -592,13 +591,7 @@ void BitcoinGUI::createActions()
592591

593592
void BitcoinGUI::createMenuBar()
594593
{
595-
#ifdef Q_OS_MAC
596-
// Create a decoupled menu bar on Mac which stays even if the window is closed
597-
appMenuBar = new QMenuBar();
598-
#else
599-
// Get the main window's menu bar on other platforms
600594
appMenuBar = menuBar();
601-
#endif
602595

603596
// Configure the menus
604597
QMenu *file = appMenuBar->addMenu(tr("&File"));
@@ -843,6 +836,7 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH
843836

844837
MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();
845838
connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, [this] {
839+
if (m_node.shutdownRequested()) return; // nothing to show, node is shutting down.
846840
showNormalIfMinimized();
847841
activateWindow();
848842
});
@@ -1124,6 +1118,8 @@ void BitcoinGUI::createIconMenu(QMenu *pmenu)
11241118
// See https://bugreports.qt.io/browse/QTBUG-91697
11251119
pmenu, &QMenu::aboutToShow,
11261120
[this, show_hide_action, send_action, cj_send_action, receive_action, sign_action, verify_action, options_action, node_window_action, quit_action, repair_action, backups_action, info_action, graph_action, peer_action, conf_action] {
1121+
if (m_node.shutdownRequested()) return; // nothing to do, node is shutting down.
1122+
11271123
if (show_hide_action) show_hide_action->setText(
11281124
(!isHidden() && !isMinimized() && !GUIUtil::isObscured(this)) ?
11291125
tr("&Hide") :

0 commit comments

Comments
 (0)