mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 16:42:54 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user