diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-11-24 12:17:35 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-11-24 12:17:39 +0100 |
commit | db5e22e0537ae262270660201519c5c20f30951a (patch) | |
tree | 4c6140c0448ab95f50041655d272591875337d54 /src/qt/bitcoingui.cpp | |
parent | 93566e0c37c5ae104095474fea89f00dcb40f551 (diff) | |
parent | ed998ea7a0ecf294211b06e9ef82f1548a621a1d (diff) |
Merge #9190: qt: Plug many memory leaks
ed998ea qt: Avoid OpenSSL certstore-related memory leak (Wladimir J. van der Laan)
5204598 qt: Avoid shutdownwindow-related memory leak (Wladimir J. van der Laan)
e4f126a qt: Avoid splash-screen related memory leak (Wladimir J. van der Laan)
693384e qt: Prevent thread/memory leak on exiting RPCConsole (Wladimir J. van der Laan)
47db075 qt: Plug many memory leaks (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index b7302e3969..6112a1d256 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -511,6 +511,13 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel) // Disable context menu on tray icon trayIconMenu->clear(); } + // Propagate cleared model to child objects + rpcConsole->setClientModel(nullptr); +#ifdef ENABLE_WALLET + walletFrame->setClientModel(nullptr); +#endif // ENABLE_WALLET + unitDisplayControl->setOptionsModel(nullptr); + connectionsControl->setClientModel(nullptr); } } @@ -1191,7 +1198,7 @@ void UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event) /** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */ void UnitDisplayStatusBarControl::createContextMenu() { - menu = new QMenu(); + menu = new QMenu(this); Q_FOREACH(BitcoinUnits::Unit u, BitcoinUnits::availableUnits()) { QAction *menuAction = new QAction(QString(BitcoinUnits::name(u)), this); @@ -1248,7 +1255,5 @@ void NetworkToggleStatusBarControl::mousePressEvent(QMouseEvent *event) /** Lets the control know about the Client Model */ void NetworkToggleStatusBarControl::setClientModel(ClientModel *_clientModel) { - if (_clientModel) { - this->clientModel = _clientModel; - } + this->clientModel = _clientModel; } |