]> git.tdb.fi Git - r2c2.git/commitdiff
Fix a memory leak
authorMikko Rasa <tdb@tdb.fi>
Tue, 16 Nov 2010 20:12:17 +0000 (20:12 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 16 Nov 2010 20:12:17 +0000 (20:12 +0000)
source/designer/trackwrap.cpp
source/designer/trackwrap.h

index 65c33d5a1ffb0200ffc13adecfd08aa33fc39d7d..5e21ddc326b39e354c4a3ddf5e7c59e39aee3932 100644 (file)
@@ -23,6 +23,12 @@ TrackWrap::TrackWrap(Designer &d, Selection &s):
        selection.signal_changed.connect(sigc::mem_fun(this, &TrackWrap::selection_changed));
 }
 
+TrackWrap::~TrackWrap()
+{
+       for(map<const TrackType *, GL::Mesh *>::iterator i=meshes.begin(); i!=meshes.end(); ++i)
+               delete i->second;
+}
+
 void TrackWrap::render(const GL::Tag &) const
 {
        for(list<Wrap>::const_iterator i=wraps.begin(); i!=wraps.end(); ++i)
index 2f21125c6b703b2ba05b97b834ec5637c7570565..36285150dc58b619946f74efb597d3e81ee6f196 100644 (file)
@@ -31,6 +31,7 @@ private:
 
 public:
        TrackWrap(Designer &, Selection &);
+       ~TrackWrap();
 
        virtual void render(const Msp::GL::Tag &) const;