]> git.mxchange.org Git - flightgear.git/commitdiff
Mathias Fröhlich:
authorehofman <ehofman>
Fri, 14 Oct 2005 16:25:14 +0000 (16:25 +0000)
committerehofman <ehofman>
Fri, 14 Oct 2005 16:25:14 +0000 (16:25 +0000)
I have done a valgrind run in flightgear. Just start it up and close it at the
fist change I had about half an hour later.

source-leak.diff:
   Also two minor ones, but leaks ...

src/GUI/new_gui.cxx
src/GUI/new_gui.hxx
src/Scenery/tileentry.cxx

index a93a0ce1e7b2043a528c3a64e9d34a19d17a93d8..df81cb1fd13b651e685dde4dec6d59c8ee89614a 100644 (file)
@@ -181,6 +181,9 @@ NewGUI::clear ()
     delete _menubar;
     _menubar = 0;
     _dialog_props.clear();
+    _itt_t it;
+    for (it = _colors.begin(); it != _colors.end(); ++it)
+      delete it->second;
     _colors.clear();
 }
 
@@ -265,6 +268,9 @@ NewGUI::readDir (const char * path)
 void
 NewGUI::setStyle (void)
 {
+    _itt_t it;
+    for (it = _colors.begin(); it != _colors.end(); ++it)
+      delete it->second;
     _colors.clear();
 
     // set up the traditional colors as default
index 8cc39b4753d960246e44a39243d86f547e5915e1..2d00adfcc2a82bb6c3f14653ecd7e4c562b3671b 100644 (file)
@@ -155,11 +155,11 @@ public:
     virtual FGDialog * getActiveDialog ();
 
     virtual FGColor *getColor (const char * name) const {
-        _itt_t it = _colors.find(name);
+        _citt_t it = _colors.find(name);
         return (it != _colors.end()) ? it->second : NULL;
     }
     virtual FGColor *getColor (const string &name) const {
-        _itt_t it = _colors.find(name.c_str());
+        _citt_t it = _colors.find(name.c_str());
         return (it != _colors.end()) ? it->second : NULL;
     }
 
@@ -203,7 +203,8 @@ private:
     fntTexFont _tex_font;
     puFont _font;
     map<const char*,FGColor*, ltstr> _colors;
-    typedef map<const char*,FGColor*, ltstr>::const_iterator _itt_t;
+    typedef map<const char*,FGColor*, ltstr>::iterator _itt_t;
+    typedef map<const char*,FGColor*, ltstr>::const_iterator _citt_t;
 
     // Free all allocated memory.
     void clear ();
index b0639d5880745e6f3d3fad479940dc81f92acd16..a457c76c35b584416dd1c409754467be755502b0 100644 (file)
@@ -978,6 +978,8 @@ FGTileEntry::load( const string_list &path_list, bool is_base )
     if ( taxi_lights_transform->getNumKids() > 0 ) {
         taxi_lights_transform->setTransform( sgdTrans );
     }
+
+    delete light_pts;
 }
 
 void