From 63b27cb1b59043c9e14a29b0bfc43cb5abdb80e6 Mon Sep 17 00:00:00 2001 From: maxcorsini Date: Fri, 12 Oct 2007 14:02:39 +0000 Subject: [PATCH] solve memory leak in dtor --- wrap/gui/trackball.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/wrap/gui/trackball.cpp b/wrap/gui/trackball.cpp index 783995e2..60b6632e 100644 --- a/wrap/gui/trackball.cpp +++ b/wrap/gui/trackball.cpp @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.22 2007/07/09 22:47:18 benedetti +Removed using namespace std and modified accordingly. + Revision 1.21 2007/06/20 12:59:43 corsini adjust wheel back-compatibility @@ -113,10 +116,14 @@ Trackball::Trackball(): current_button(0), current_mode(NULL), inactive_mode(NUL setDefaultMapping (); } -Trackball::~Trackball() { - //map::iterator i; - //for(i = modes.begin(); i != modes.end(); i++) - // delete (*i).second; +Trackball::~Trackball() +{ + std::map::iterator it; + for(it = modes.begin(); it != modes.end(); it++) + { + if ((*it).second) + delete (*it).second; + } }