mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Guarding QTimer::singelShot operations, avoid to access dangling pointers
This commit is contained in:
committed by
Roland Winklmeier
parent
b5ba4013dd
commit
1b8383bee1
@@ -69,7 +69,12 @@ namespace BlackGui
|
||||
bool CConfigurationWizard::event(QEvent *event)
|
||||
{
|
||||
if (event->type() != QEvent::EnterWhatsThisMode) { return QDialog::event(event); }
|
||||
QTimer::singleShot(0, this, [ = ] { sGui->showHelp(this); });
|
||||
const QPointer<CConfigurationWizard> guard(this);
|
||||
QTimer::singleShot(0, this, [ = ]
|
||||
{
|
||||
if (guard.isNull() || !sGui || sGui->isShuttingDown()) { return; }
|
||||
sGui->showHelp(this);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user