mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Guarding QTimer::singelShot operations, avoid to access dangling pointers
This commit is contained in:
committed by
Roland Winklmeier
parent
b5ba4013dd
commit
1b8383bee1
@@ -87,9 +87,10 @@ namespace BlackGui
|
||||
{
|
||||
ui->comp_SimulatorSelector->setValue(simulator);
|
||||
ui->le_Simulator->setText(simulator.toQString(true));
|
||||
QTimer::singleShot(500, [this]()
|
||||
const QPointer<CDbOwnModelSetComponent> guard(this);
|
||||
QTimer::singleShot(500, [ = ]()
|
||||
{
|
||||
if (!sApp || sApp->isShuttingDown()) { return; }
|
||||
if (guard.isNull() || !sApp || sApp->isShuttingDown()) { return; }
|
||||
this->updateViewToCurrentModels();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user