[QT] some mac specifiy cleanup (memory handling, unnecessary code)

This commit is contained in:
Jonas Schnelli 2015-03-13 15:40:53 +01:00
parent 89e70e931d
commit 8b60808c1e
3 changed files with 7 additions and 10 deletions

View file

@ -237,7 +237,7 @@ BitcoinGUI::~BitcoinGUI()
trayIcon->hide();
#ifdef Q_OS_MAC
delete appMenuBar;
MacDockIconHandler::instance()->setMainWindow(NULL);
MacDockIconHandler::cleanup();
#endif
delete rpcConsole;

View file

@ -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;

View file

@ -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)