From 09acea6eb45290779f7afaf7a71368c1a377a6fc Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 24 Sep 2018 00:54:09 +0200 Subject: [PATCH] Ref T370, re-init terrain probe when all objects are removed --- .../simulator/fsxcommon/simulatorfsxcommon.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 27abe9a31..ea3f7e818 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -2107,6 +2107,7 @@ namespace BlackSimPlugin void CSimulatorFsxCommon::clearAllRemoteAircraftData() { + const bool reinitProbe = m_useFsxTerrainProbe; this->removeAllProbes(); // m_addAgainAircraftWhenRemoved cleared below @@ -2114,6 +2115,18 @@ namespace BlackSimPlugin m_simConnectObjects.clear(); m_addPendingAircraft.clear(); m_simConnectObjectsPositionAndPartsTraces.clear(); + + if (reinitProbe) + { + // if we are still alive we re-init the probes + QPointer myself(this); + QTimer::singleShot(2000, this, [ = ] + { + // Shutdown or unloaded + if (!sApp || sApp->isShuttingDown() || !myself) { return; } + m_initFsxTerrainProbes = false; // probes will re-init + }); + } } QString CSimulatorFsxCommon::fsxPositionToString(const SIMCONNECT_DATA_INITPOSITION &position)