diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-03-13 15:40:53 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-16 13:56:34 +0100 |
commit | 2c0840631d560c5621063d163728932212e8db60 (patch) | |
tree | 59ada3daf5d8ed3db3fd31cb7361e884b876582e /src | |
parent | 81145a6ccd1060ce4b53c98b819a12bd0a99854f (diff) |
[QT] some mac specifiy cleanup (memory handling, unnecessary code)
Rebased-From: 8b60808c1eaddb402a699ba53d865932e08109ec
Github-Pull: #5880
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/bitcoingui.cpp | 2 | ||||
-rw-r--r-- | src/qt/macdockiconhandler.h | 9 | ||||
-rw-r--r-- | src/qt/macdockiconhandler.mm | 6 |
3 files changed, 7 insertions, 10 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 1314e0b1c9..30b7b54de7 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -232,7 +232,7 @@ BitcoinGUI::~BitcoinGUI() trayIcon->hide(); #ifdef Q_OS_MAC delete appMenuBar; - MacDockIconHandler::instance()->setMainWindow(NULL); + MacDockIconHandler::cleanup(); #endif } diff --git a/src/qt/macdockiconhandler.h b/src/qt/macdockiconhandler.h index 1ffab75c9a..7c60908876 100644 --- a/src/qt/macdockiconhandler.h +++ b/src/qt/macdockiconhandler.h @@ -14,12 +14,6 @@ class QMenu; class QWidget; QT_END_NAMESPACE -#ifdef __OBJC__ -@class DockIconClickEventHandler; -#else -class DockIconClickEventHandler; -#endif - /** Macintosh-specific dock icon handler. */ class MacDockIconHandler : public QObject @@ -33,7 +27,7 @@ public: void setIcon(const QIcon &icon); void setMainWindow(QMainWindow *window); static MacDockIconHandler *instance(); - + static void cleanup(); void handleDockIconClickEvent(); signals: @@ -42,7 +36,6 @@ signals: private: MacDockIconHandler(); - DockIconClickEventHandler *m_dockIconClickEventHandler; QWidget *m_dummyWidget; QMenu *m_dockMenu; QMainWindow *mainWindow; diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index 5834a8dfca..e66154f144 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -68,7 +68,6 @@ void MacDockIconHandler::setMainWindow(QMainWindow *window) { MacDockIconHandler::~MacDockIconHandler() { - [this->m_dockIconClickEventHandler release]; delete this->m_dummyWidget; this->setMainWindow(NULL); } @@ -118,6 +117,11 @@ MacDockIconHandler *MacDockIconHandler::instance() return s_instance; } +void MacDockIconHandler::cleanup() +{ + delete s_instance; +} + void MacDockIconHandler::handleDockIconClickEvent() { if (this->mainWindow) |