From 40f560daecc3b53c41def783f62c3cec663ea0fa Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Thu, 16 Feb 2023 14:30:14 +0000 Subject: [PATCH] Remove star tracker items from map on close --- plugins/feature/startracker/startrackerworker.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/feature/startracker/startrackerworker.cpp b/plugins/feature/startracker/startrackerworker.cpp index 3237337e8..9055c2931 100644 --- a/plugins/feature/startracker/startrackerworker.cpp +++ b/plugins/feature/startracker/startrackerworker.cpp @@ -76,9 +76,17 @@ void StarTrackerWorker::startWork() void StarTrackerWorker::stopWork() { QMutexLocker mutexLocker(&m_mutex); - disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); - restartServer(false, 0); m_pollTimer.stop(); + disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); + + if (m_settings.m_drawSunOnMap) + removeFromMap("Sun"); + if (m_settings.m_drawMoonOnMap) + removeFromMap("Moon"); + if (m_settings.m_drawStarOnMap && (m_settings.m_target != "Sun") && (m_settings.m_target != "Moon")) + removeFromMap("Star"); + + restartServer(false, 0); } void StarTrackerWorker::handleInputMessages()