mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
Guarding QTimer::singelShot operations, avoid to access dangling pointers
This commit is contained in:
committed by
Roland Winklmeier
parent
b5ba4013dd
commit
1b8383bee1
@@ -659,8 +659,10 @@ namespace BlackGui
|
||||
{
|
||||
if (ui->cb_Heavy->isChecked())
|
||||
{
|
||||
const QPointer<CFlightPlanComponent> guard(this);
|
||||
QTimer::singleShot(10, this, [ = ]
|
||||
{
|
||||
if (guard.isNull()) { return; }
|
||||
ui->cb_Tcas->setChecked(false);
|
||||
this->buildPrefixIcaoSuffix();
|
||||
});
|
||||
@@ -671,8 +673,10 @@ namespace BlackGui
|
||||
{
|
||||
if (ui->cb_Tcas->isChecked())
|
||||
{
|
||||
const QPointer<CFlightPlanComponent> guard(this);
|
||||
QTimer::singleShot(10, this, [ = ]
|
||||
{
|
||||
if (guard.isNull()) { return; }
|
||||
ui->cb_Heavy->setChecked(false);
|
||||
this->buildPrefixIcaoSuffix();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user