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.
This commit is contained in:
Wladimir J. van der Laan
2016-11-19 14:28:55 +01:00
parent e4f126a7ba
commit 5204598f8d
3 changed files with 6 additions and 7 deletions

View File

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