aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-11-19 14:28:55 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-11-23 12:33:36 +0100
commit5204598f8d07d7432d91e9b8781806d2f3d16415 (patch)
tree6c346f17f8311f5902a1b1318d37628d597dea1a /src/qt/bitcoin.cpp
parente4f126a7ba66e7317718c30276dff6db92dc1986 (diff)
downloadbitcoin-5204598f8d07d7432d91e9b8781806d2f3d16415.tar.xz
qt: Avoid shutdownwindow-related memory leak
Store a reference to the shutdown window on BitcoinApplication, so that it will be deleted when exiting the main loop.
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r--src/qt/bitcoin.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index d63964805d..d7452f308e 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -245,6 +245,7 @@ private:
#endif
int returnValue;
const PlatformStyle *platformStyle;
+ std::unique_ptr<QWidget> shutdownWindow;
void startThread();
};
@@ -411,7 +412,7 @@ void BitcoinApplication::requestShutdown()
// Show a simple window indicating shutdown status
// Do this first as some of the steps may take some time below,
// for example the RPC console may still be executing a command.
- ShutdownWindow::showShutdownWindow(window);
+ shutdownWindow.reset(ShutdownWindow::showShutdownWindow(window));
qDebug() << __func__ << ": Requesting shutdown";
startThread();