FGAISchedule::~FGAISchedule()
{
+ // remove related object from AI manager
+ if (AIManagerRef)
+ {
+ FGAIManager* aimgr = (FGAIManager *) globals-> get_subsystem("ai-model");
+ if (aimgr)
+ aimgr->destroyObject(AIManagerRef);
+ AIManagerRef = 0;
+ }
+
/* for (FGScheduledFlightVecIterator flt = flights.begin(); flt != flights.end(); flt++)
{
delete (*flt);
}
FGTrafficManager::~FGTrafficManager()
+{
+ shutdown();
+}
+
+void FGTrafficManager::shutdown()
{
// Save the heuristics data
bool saveData = false;
}
scheduledAircraft.clear();
flights.clear();
+ releaseList.clear();
+
+ currAircraft = scheduledAircraft.begin();
+ doingInit = false;
+ inited = false;
}
void FGTrafficManager::update(double /*dt */ )
{
- if (!enabled || (realWxEnabled && !metarValid)) {
+ if (!enabled)
+ {
+ if (inited || doingInit)
+ shutdown();
+ return;
+ }
+
+ if ((realWxEnabled && !metarValid)) {
return;
}