Hello everybody,

a valgrind log of recent FlightGear is available from
http://dl.dropbox.com/u/15761796/valgrind.log
(13 MB). A short version containing only the "definitely lost"
backtraces is at
http://dl.dropbox.com/u/15761796/definitely_lost.log
(59 kB).

The largest single entry stems from the TrafficMgr code. It is fixed by
the attached patch, which deletes all scheduled flights.

However, as I quit the program as soon as the 3D clouds showed up, I
suspect that with increased run time other leaks might become more
important, possibly the ones regarding
simgear/scene/model/SGReaderWriterXML.cxx:289.

Some things that might be fixed relatively easy:
FG/src/Autopilot/digitalfilter.cxx: all InputValues pushed_back to one
of the InputValueLists need to be deleted
FG/src/Autopilot/digitalfilter.cxx:316: members of componentForge need
to be deleted
FG/src/Autopilot/autopilot.cxx:46: the same
FG/src/Instrumentation/gps.cxx:1575: _currentWaypt needs to be deleted
FG/src/AIModel/performancedb.cxx:88 members of _db need to be deleted

Hope this helps a little in stuffing the sieve,
best regards,
        Andreas
diff --git a/src/Traffic/SchedFlight.hxx b/src/Traffic/SchedFlight.hxx
index 0ee3eb6..5d2f3fd 100644
--- a/src/Traffic/SchedFlight.hxx
+++ b/src/Traffic/SchedFlight.hxx
@@ -115,6 +115,7 @@ typedef vector<FGScheduledFlight*>           FGScheduledFlightVec;
 typedef vector<FGScheduledFlight*>::iterator FGScheduledFlightVecIterator;
 
 typedef std::map < std::string, FGScheduledFlightVec > FGScheduledFlightMap;
+typedef std::map < std::string, FGScheduledFlightVec >::iterator FGScheduledFlightMapIterator;
 
 bool compareScheduledFlights(FGScheduledFlight *a, FGScheduledFlight *b);
 
diff --git a/src/Traffic/TrafficMgr.cxx b/src/Traffic/TrafficMgr.cxx
index 4abbc1a..7213175 100644
--- a/src/Traffic/TrafficMgr.cxx
+++ b/src/Traffic/TrafficMgr.cxx
@@ -66,7 +66,7 @@
 #include <Main/fg_init.hxx>
 
 
-
+#include "SchedFlight.hxx"
 #include "TrafficMgr.hxx"
 
 using std::sort;
@@ -124,6 +124,12 @@ FGTrafficManager::~FGTrafficManager()
         cachefile.close();
     }
     scheduledAircraft.clear();
+    FGScheduledFlightMapIterator itm;
+    FGScheduledFlightVecIterator itv;
+    for (itm = flights.begin(); itm != flights.end(); ++itm) {
+      for (itv = itm->second.begin(); itv != itm->second.end(); ++itv)
+        delete (*itv);
+    }
     flights.clear();
 }
 
diff --git a/src/ATCDCL/ATCmgr.cxx b/src/ATCDCL/ATCmgr.cxx
index 537bfdd..2da7e53 100644
--- a/src/ATCDCL/ATCmgr.cxx
+++ b/src/ATCDCL/ATCmgr.cxx
@@ -63,6 +63,10 @@ FGATCMgr::FGATCMgr() :
 
 FGATCMgr::~FGATCMgr() {
     delete v1;
+    for (airport_atc_map_itr = airport_atc_map.begin();
+         airport_atc_map_itr != airport_atc_map.end();
+         ++airport_atc_map_itr)
+      delete airport_atc_map_itr->second;
 }
 
 void FGATCMgr::bind() {
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to