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:
committed by
lateminer
parent
df6a9014b7
commit
e9c62ea15a
@@ -246,6 +246,7 @@ private:
|
||||
#endif
|
||||
int returnValue;
|
||||
const PlatformStyle *platformStyle;
|
||||
std::unique_ptr<QWidget> shutdownWindow;
|
||||
|
||||
void startThread();
|
||||
};
|
||||
@@ -410,6 +411,11 @@ void BitcoinApplication::requestInitialize(Config &config)
|
||||
|
||||
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.reset(ShutdownWindow::showShutdownWindow(window));
|
||||
|
||||
qDebug() << __func__ << ": Requesting shutdown";
|
||||
startThread();
|
||||
window->hide();
|
||||
|
||||
Reference in New Issue
Block a user