diff options
author | Cory Fields <theuni-nospam-@xbmc.org> | 2013-06-04 23:44:53 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-11-26 14:00:48 +0100 |
commit | 068996daa55e5ac89aaead6afb7b393550ec0933 (patch) | |
tree | 29c0d237a9eb335563e2f580a31fe03973bb825f | |
parent | 99f73bd2fda6fa27a65d9559f9ba35bf11100f5d (diff) |
osx: fix bitcoin-qt startup crash when clicking dock icon
Crash probably introduced by 4d17a1b0.
Inialize the window to NULL and verify it before use.
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
-rw-r--r-- | src/qt/macdockiconhandler.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index b6ea8e1d03..02117536cb 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -52,6 +52,8 @@ MacDockIconHandler::MacDockIconHandler() : QObject() this->m_dummyWidget = new QWidget(); this->m_dockMenu = new QMenu(this->m_dummyWidget); qt_mac_set_dock_menu(this->m_dockMenu); + this->setMainWindow(NULL); + [pool release]; } @@ -100,8 +102,11 @@ MacDockIconHandler *MacDockIconHandler::instance() void MacDockIconHandler::handleDockIconClickEvent() { - this->mainWindow->activateWindow(); - this->mainWindow->show(); + if (this->mainWindow) + { + this->mainWindow->activateWindow(); + this->mainWindow->show(); + } emit this->dockIconClicked(); } |