X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fgroundnetwork.cxx;h=62449b0cb13fe04cc6c499e0131630ec21609e27;hb=fd99e9fdfb47fd1a2ed85c9fa9757ed5fc030514;hp=c20cf2bea9b262613864f293fccdfc8a7a3d20ef;hpb=8a087582bcf6bda954dee70ed1f48fe64a09aac2;p=flightgear.git diff --git a/src/Airports/groundnetwork.cxx b/src/Airports/groundnetwork.cxx index c20cf2bea..62449b0cb 100644 --- a/src/Airports/groundnetwork.cxx +++ b/src/Airports/groundnetwork.cxx @@ -53,6 +53,7 @@ #include "groundnetwork.hxx" +using std::string; /*************************************************************************** * FGTaxiSegment @@ -251,7 +252,8 @@ bool compare_trafficrecords(FGTrafficRecord a, FGTrafficRecord b) return (a.getIntentions().size() < b.getIntentions().size()); } -FGGroundNetwork::FGGroundNetwork() +FGGroundNetwork::FGGroundNetwork() : + parent(NULL) { hasNetwork = false; foundRoute = false; @@ -268,11 +270,18 @@ FGGroundNetwork::FGGroundNetwork() FGGroundNetwork::~FGGroundNetwork() { +// JMT 2012-09-8 - disabling the groundnet-caching as part of enabling the +// navcache. The problem isn't the NavCache - it's that for the past few years, +// we have not being running destructors on FGPositioned classes, and hence, +// not running this code. +// When I fix FGPositioned lifetimes (unloading-at-runtime support), this +// will need to be re-visited so it can run safely during shutdown. +#if 0 //cerr << "Running Groundnetwork Destructor " << endl; bool saveData = false; ofstream cachefile; if (fgGetBool("/sim/ai/groundnet-cache")) { - SGPath cacheData(fgGetString("/sim/fg-home")); + SGPath cacheData(globals->get_fg_home()); cacheData.append("ai"); string airport = parent->getId(); @@ -309,6 +318,7 @@ FGGroundNetwork::~FGGroundNetwork() if (saveData) { cachefile.close(); } +#endif } void FGGroundNetwork::saveElevationCache() { @@ -316,7 +326,7 @@ void FGGroundNetwork::saveElevationCache() { bool saveData = false; ofstream cachefile; if (fgGetBool("/sim/ai/groundnet-cache")) { - SGPath cacheData(fgGetString("/sim/fg-home")); + SGPath cacheData(globals->get_fg_home()); cacheData.append("ai"); string airport = parent->getId(); @@ -432,7 +442,7 @@ void FGGroundNetwork::init() //cerr << "Done initializing ground network" << endl; //exit(1); if (fgGetBool("/sim/ai/groundnet-cache")) { - SGPath cacheData(fgGetString("/sim/fg-home")); + SGPath cacheData(globals->get_fg_home()); cacheData.append("ai"); string airport = parent->getId();