From dafa6ced1be06f2f5517cfc81454c62bb5990c00 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 14 Oct 2005 16:25:14 +0000 Subject: [PATCH] =?UTF-8?q?Mathias=20Fr=F6hlich:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 6 ++++++ src/GUI/new_gui.hxx | 7 ++++--- src/Scenery/tileentry.cxx | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index a93a0ce1e..df81cb1fd 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -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 diff --git a/src/GUI/new_gui.hxx b/src/GUI/new_gui.hxx index 8cc39b475..2d00adfcc 100644 --- a/src/GUI/new_gui.hxx +++ b/src/GUI/new_gui.hxx @@ -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 _colors; - typedef map::const_iterator _itt_t; + typedef map::iterator _itt_t; + typedef map::const_iterator _citt_t; // Free all allocated memory. void clear (); diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index b0639d588..a457c76c3 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -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