]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/gps.cxx
Miscellaneous tweaks and Bugfixes. Mostly memory leaks ported from the plib
[flightgear.git] / src / Instrumentation / gps.cxx
index b466948c42d3a1bc08ff96283de84c1154f2b25f..76b8974bf71aa4c54cdbaa0132e9522888c41b38 100644 (file)
@@ -43,17 +43,20 @@ GPS::GPS ( SGPropertyNode *node)
       _distance_m(0),
       _course_deg(0),
       _name(node->getStringValue("name", "gps")),
-      _num(node->getIntValue("number", 0))
+      _num(node->getIntValue("number", 0)),
+      route(0)
 {
 }
 
 GPS::~GPS ()
 {
+    delete route;
 }
 
 void
 GPS::init ()
 {
+    delete route; // in case init is called twice
     route = new SGRoute;
     route->clear();