]> git.mxchange.org Git - flightgear.git/commitdiff
Modified Files:
authorfrohlich <frohlich>
Wed, 14 Feb 2007 17:51:23 +0000 (17:51 +0000)
committerfrohlich <frohlich>
Wed, 14 Feb 2007 17:51:23 +0000 (17:51 +0000)
src/Navaids/awynet.cxx src/Navaids/awynet.hxx: Olaf Flebbe:
Implement ~FGAirwayNetwork, though it is not called now
Guard snprint properly.

src/Navaids/awynet.cxx
src/Navaids/awynet.hxx

index 564b4bfb78bc1feb8a280dc49c12e922bc48bfda..0bc2b7e2f32137e1e001744c5464981d0d10cd44 100755 (executable)
@@ -141,6 +141,12 @@ FGAirwayNetwork::FGAirwayNetwork()
   maxDistance = 0;
 }
 
+FGAirwayNetwork::~FGAirwayNetwork()
+{
+    for (unsigned int it = 0; it < nodes.size(); it++) {
+       delete nodes[ it];
+    }
+}
 void FGAirwayNetwork::addAirway(const FGAirway &seg)
 {
   segments.push_back(seg);
@@ -262,7 +268,8 @@ void FGAirwayNetwork::load(SGPath path)
       char buffer[32];
       string startNode, endNode;
       // Start
-      snprintf(buffer, 32, "%s%d%d", identStart.c_str(), (int) latStart, (int) lonStart);
+      buffer[sizeof(buffer)-1] = 0;
+      snprintf(buffer, sizeof(buffer)-1, "%s%d%d", identStart.c_str(), (int) latStart, (int) lonStart);
       startNode = buffer;
 
       node_map_iterator itr = nodesMap.find(string(buffer));
index a2f4dd6987f28b08bc2fdf9a77103990b8f44730..e0fe2b474808f3d12caa22079a345591121fa6ab 100755 (executable)
@@ -192,6 +192,7 @@ private:
 
 public:
   FGAirwayNetwork();
+  ~FGAirwayNetwork();
 
   //void addNode   (const FGNode& node);
   //void addNodes  (FGParkingVec *parkings);