]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/groundnetwork.cxx
std namespace fixes in headers.
[flightgear.git] / src / Airports / groundnetwork.cxx
index c20cf2bea9b262613864f293fccdfc8a7a3d20ef..62449b0cb13fe04cc6c499e0131630ec21609e27 100644 (file)
@@ -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();