Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,7 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle)
{
assert(!m_splash);
m_splash = new SplashScreen(networkStyle);
// We don't hold a direct pointer to the splash screen after creation, but the splash
// screen will take care of deleting itself when finish() happens.
m_splash->show();
connect(this, &BitcoinApplication::splashFinished, m_splash, &SplashScreen::finish);
connect(this, &BitcoinApplication::requestedShutdown, m_splash, &QWidget::close);
}

void BitcoinApplication::createNode(interfaces::Init& init)
Expand Down Expand Up @@ -373,6 +369,9 @@ void BitcoinApplication::requestShutdown()
w->hide();
}

delete m_splash;
m_splash = nullptr;

// 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.
Expand Down Expand Up @@ -412,10 +411,13 @@ void BitcoinApplication::requestShutdown()
void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info)
{
qDebug() << __func__ << ": Initialization result: " << success;

// Set exit result.
returnValue = success ? EXIT_SUCCESS : EXIT_FAILURE;
if(success)
{
if(success) {
delete m_splash;
m_splash = nullptr;

// Log this only after AppInitMain finishes, as then logging setup is guaranteed complete
qInfo() << "Platform customization:" << platformStyle->getName();
clientModel = new ClientModel(node(), optionsModel);
Expand All @@ -438,7 +440,6 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
} else {
window->showMinimized();
}
Q_EMIT splashFinished();
Q_EMIT windowShown(window);

#ifdef ENABLE_WALLET
Expand All @@ -455,7 +456,6 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
#endif
pollShutdownTimer->start(SHUTDOWN_POLLING_DELAY);
} else {
Q_EMIT splashFinished(); // Make sure splash screen doesn't stick around during shutdown
requestShutdown();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/qt/bitcoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public Q_SLOTS:
Q_SIGNALS:
void requestedInitialize();
void requestedShutdown();
void splashFinished();
void windowShown(BitcoinGUI* window);

protected:
Expand Down
10 changes: 0 additions & 10 deletions src/qt/splashscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,6 @@ bool SplashScreen::eventFilter(QObject * obj, QEvent * ev) {
return QObject::eventFilter(obj, ev);
}

void SplashScreen::finish()
{
/* If the window is minimized, hide() will be ignored. */
/* Make sure we de-minimize the splashscreen window before hiding */
if (isMinimized())
showNormal();
hide();
deleteLater(); // No more need for this
}

static void InitMessage(SplashScreen *splash, const std::string &message)
{
bool invoked = QMetaObject::invokeMethod(splash, "showMessage",
Expand Down
3 changes: 0 additions & 3 deletions src/qt/splashscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class SplashScreen : public QWidget
void closeEvent(QCloseEvent *event) override;

public Q_SLOTS:
/** Hide the splash screen window and schedule the splash screen object for deletion */
void finish();

/** Show message and progress */
void showMessage(const QString &message, int alignment, const QColor &color);

Expand Down