Clear ATC on the user aircraft as well
Avoids an assert/crash on exit, in some ATC configurations.
This commit is contained in:
parent
a458d46349
commit
8085d1fa2c
3 changed files with 15 additions and 5 deletions
|
@ -120,7 +120,7 @@ FGAIAircraft::~FGAIAircraft()
|
|||
assert(!controller);
|
||||
if (controller) {
|
||||
// we no longer signOff from controller here, controller should
|
||||
// have been cleared using clearATCCOntrollers
|
||||
// have been cleared using clearATCControllers
|
||||
// see FLIGHTGEAR-15 on Sentry
|
||||
SG_LOG(SG_AI, SG_ALERT, "Destruction of AIAircraft which was not unbound");
|
||||
}
|
||||
|
|
|
@ -319,7 +319,14 @@ FGAIManager::shutdown()
|
|||
|
||||
ai_list.clear();
|
||||
_environmentVisiblity.clear();
|
||||
_userAircraft.clear();
|
||||
|
||||
if (_userAircraft) {
|
||||
_userAircraft->setDie(true);
|
||||
// we can't unbind() but we do need to clear these
|
||||
_userAircraft->clearATCController();
|
||||
_userAircraft.clear();
|
||||
}
|
||||
|
||||
static_haveRegisteredScenarios = false;
|
||||
|
||||
globals->get_commands()->removeCommand("load-scenario");
|
||||
|
|
|
@ -59,9 +59,12 @@ namespace {
|
|||
|
||||
void clearTrafficControllers(TrafficVector& vec)
|
||||
{
|
||||
TrafficVectorIterator it = vec.begin();
|
||||
for (; it != vec.end(); ++it) {
|
||||
it->getAircraft()->clearATCController();
|
||||
for (const auto& traffic : vec) {
|
||||
if (!traffic.getAircraft()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
traffic.getAircraft()->clearATCController();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue