paranoid check in case of recurrence of race described in refs #270

This commit is contained in:
Mathew Sutcliffe
2014-06-19 22:14:06 +01:00
parent fede3fc4c7
commit 997eb17f96

View File

@@ -136,9 +136,13 @@ namespace BlackCore
aircraft.setSituation(simulatorAircraft.getSituation());
aircraft.setCockpit(simulatorAircraft.getCom1System(), simulatorAircraft.getCom2System(), simulatorAircraft.getTransponderCode());
// the method will check, if an update is really required
// these are local (non DBus) calls
this->getIContextOwnAircraft()->updateOwnAircraft(aircraft, this->getPathAndContextId());
Q_ASSERT(this->getIContextOwnAircraft()); // paranoia against context having been deleted from another thread - redmine issue #270
if (!this->getIContextOwnAircraft())
{
// the method will check, if an update is really required
// these are local (non DBus) calls
this->getIContextOwnAircraft()->updateOwnAircraft(aircraft, this->getPathAndContextId());
}
}
void CContextSimulator::addAircraftSituation(const CCallsign &callsign, const CAircraftSituation &initialSituation)