mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 04:35:41 +08:00
Check pointer for QTimer::singleShot
This commit is contained in:
committed by
Roland Winklmeier
parent
3d2a74a652
commit
0dca6db4bf
@@ -1404,8 +1404,10 @@ namespace BlackSimPlugin
|
|||||||
// missing lights info from simulator so far
|
// missing lights info from simulator so far
|
||||||
if (this->showDebugLogMessage()) { this->debugLogMessage(Q_FUNC_INFO, QString("Missing light state in simulator for '%1', model '%2'").arg(callsign.asString(), simObj.getAircraftModelString())); }
|
if (this->showDebugLogMessage()) { this->debugLogMessage(Q_FUNC_INFO, QString("Missing light state in simulator for '%1', model '%2'").arg(callsign.asString(), simObj.getAircraftModelString())); }
|
||||||
|
|
||||||
|
const QPointer<CSimulatorFsxCommon> myself(this);
|
||||||
QTimer::singleShot(DeferResendingLights, this, [ = ]
|
QTimer::singleShot(DeferResendingLights, this, [ = ]
|
||||||
{
|
{
|
||||||
|
if (myself.isNull()) { return; }
|
||||||
if (!m_simConnectObjects.contains(callsign)) { return; }
|
if (!m_simConnectObjects.contains(callsign)) { return; }
|
||||||
const CSimConnectObject currentSimObject = m_simConnectObjects[callsign];
|
const CSimConnectObject currentSimObject = m_simConnectObjects[callsign];
|
||||||
if (!currentSimObject.hasValidRequestAndObjectId()) { return; } // stale
|
if (!currentSimObject.hasValidRequestAndObjectId()) { return; } // stale
|
||||||
|
|||||||
Reference in New Issue
Block a user