mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Use "myself" QPointer with "sGui->processEventsToRefreshGui"
Rational: during "sGui->processEventsToRefreshGui" object can be deleted
This commit is contained in:
committed by
Mat Sutcliffe
parent
0e916864cb
commit
bd1ef5dfea
@@ -225,6 +225,7 @@ namespace BlackGui
|
||||
if (!m_splashScreen) { return; }
|
||||
this->displaySplashMessage(m);
|
||||
this->processEventsToRefreshGui();
|
||||
if (!sGui) { return; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,16 +51,18 @@ namespace BlackGui
|
||||
m_angle = 0;
|
||||
this->show();
|
||||
this->setEnabled(true);
|
||||
|
||||
QPointer<CLoadIndicator> myself(this);
|
||||
if (m_timerId == -1) { m_timerId = startTimer(m_delayMs); }
|
||||
if (processEvents && sGui)
|
||||
{
|
||||
sGui->processEventsToRefreshGui();
|
||||
if (!myself) { return -1; } // deleted in meantime (process events)
|
||||
}
|
||||
|
||||
const int stopId = m_currentId++; // copy
|
||||
if (timeoutMs > 0)
|
||||
{
|
||||
QPointer<CLoadIndicator> myself(this);
|
||||
QTimer::singleShot(timeoutMs, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
|
||||
Reference in New Issue
Block a user