mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 15:15:39 +08:00
Guarding QTimer::singelShot operations, avoid to access dangling pointers
This commit is contained in:
committed by
Roland Winklmeier
parent
b5ba4013dd
commit
1b8383bee1
@@ -508,7 +508,12 @@ namespace BlackGui
|
||||
|
||||
// call this deferred, otherwise the values are overridden with any values
|
||||
// from the UI builder
|
||||
QTimer::singleShot(500, this, &CViewBaseNonTemplate::settingsChanged);
|
||||
const QPointer<CViewBaseNonTemplate> guard(this);
|
||||
QTimer::singleShot(500, this, [ = ]()
|
||||
{
|
||||
if (guard.isNull()) { return; }
|
||||
CViewBaseNonTemplate::settingsChanged();
|
||||
});
|
||||
}
|
||||
|
||||
QString CViewBaseNonTemplate::getSettingsFileName(bool load) const
|
||||
|
||||
Reference in New Issue
Block a user