@@ -311,11 +311,8 @@ void BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle)
311
311
{
312
312
assert (!m_splash);
313
313
m_splash = new SplashScreen (networkStyle);
314
- // We don't hold a direct pointer to the splash screen after creation, but the splash
315
- // screen will take care of deleting itself when finish() happens.
316
314
m_splash->show ();
317
315
connect (this , &BitcoinApplication::splashFinished, m_splash, &SplashScreen::finish);
318
- connect (this , &BitcoinApplication::requestedShutdown, m_splash, &QWidget::close);
319
316
}
320
317
321
318
void BitcoinApplication::createNode (interfaces::Init& init)
@@ -373,6 +370,9 @@ void BitcoinApplication::requestShutdown()
373
370
w->hide ();
374
371
}
375
372
373
+ delete m_splash;
374
+ m_splash = nullptr ;
375
+
376
376
// Show a simple window indicating shutdown status
377
377
// Do this first as some of the steps may take some time below,
378
378
// for example the RPC console may still be executing a command.
@@ -412,10 +412,13 @@ void BitcoinApplication::requestShutdown()
412
412
void BitcoinApplication::initializeResult (bool success, interfaces::BlockAndHeaderTipInfo tip_info)
413
413
{
414
414
qDebug () << __func__ << " : Initialization result: " << success;
415
+
415
416
// Set exit result.
416
417
returnValue = success ? EXIT_SUCCESS : EXIT_FAILURE;
417
- if (success)
418
- {
418
+ if (success) {
419
+ delete m_splash;
420
+ m_splash = nullptr ;
421
+
419
422
// Log this only after AppInitMain finishes, as then logging setup is guaranteed complete
420
423
qInfo () << " Platform customization:" << platformStyle->getName ();
421
424
clientModel = new ClientModel (node (), optionsModel);
@@ -438,7 +441,6 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
438
441
} else {
439
442
window->showMinimized ();
440
443
}
441
- Q_EMIT splashFinished ();
442
444
Q_EMIT windowShown (window);
443
445
444
446
#ifdef ENABLE_WALLET
@@ -455,7 +457,6 @@ void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHead
455
457
#endif
456
458
pollShutdownTimer->start (SHUTDOWN_POLLING_DELAY);
457
459
} else {
458
- Q_EMIT splashFinished (); // Make sure splash screen doesn't stick around during shutdown
459
460
requestShutdown ();
460
461
}
461
462
}
0 commit comments