From 6e39b69933905a1c16112127e7b3b137327f605a Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 16 Oct 2017 01:04:06 +0200 Subject: [PATCH] Ref T171, locker for interpolator/rendering setup. Actually this was missing, in other parts the lock was already used. --- src/blackcore/simulatorcommon.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/blackcore/simulatorcommon.cpp b/src/blackcore/simulatorcommon.cpp index b145499dc..306679db7 100644 --- a/src/blackcore/simulatorcommon.cpp +++ b/src/blackcore/simulatorcommon.cpp @@ -402,8 +402,9 @@ namespace BlackCore const QString part2 = parser.part(2).toLower(); if (part2 == "off" || part2 == "false") { - m_interpolationRenderingSetup.clearInterpolatorLogCallsigns(); CStatusMessage(this).info("Disabled interpolation logging"); + QWriteLocker l(&m_interpolationRenderingSetupMutex); + m_interpolationRenderingSetup.clearInterpolatorLogCallsigns(); return true; } if (part2 == "clear" || part2 == "clr") @@ -415,7 +416,10 @@ namespace BlackCore if (part2 == "write" || part2 == "save") { // stop logging of other log - m_interpolationRenderingSetup.clearInterpolatorLogCallsigns(); + { + QWriteLocker l(&m_interpolationRenderingSetupMutex); + m_interpolationRenderingSetup.clearInterpolatorLogCallsigns(); + } // write m_interpolationLogger.writeLogInBackground(); @@ -441,8 +445,9 @@ namespace BlackCore if (!CCallsign::isValidAircraftCallsign(cs)) { return false; } if (this->getAircraftInRangeCallsigns().contains(cs)) { - m_interpolationRenderingSetup.addCallsignToLog(CCallsign(cs)); CLogMessage(this).info("Will log interpolation for '%1'") << cs; + QWriteLocker l(&m_interpolationRenderingSetupMutex); + m_interpolationRenderingSetup.addCallsignToLog(CCallsign(cs)); return true; } else