]> git.tdb.fi Git - r2c2.git/commitdiff
Fix valgrind errors
authorMikko Rasa <tdb@tdb.fi>
Tue, 23 Nov 2010 05:42:12 +0000 (05:42 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 23 Nov 2010 05:42:12 +0000 (05:42 +0000)
source/designer/designer.cpp
source/designer/routebar.h
source/designer/zonebar.h
source/libr2c2/layout.cpp

index 5f125fd11c64a0ed44e90321568364a948b30994..5974816c65c1e2f4cff15df134d0e9f36c2f3e67 100644 (file)
@@ -164,6 +164,8 @@ Designer::Designer(int argc, char **argv):
 
 Designer::~Designer()
 {
+       for(vector<Toolbar *>::iterator i=toolbars.begin(); i!=toolbars.end(); ++i)
+               delete *i;
        delete overlay;
        delete pipeline;
        delete base_object;
index 005b0044a02dd682ef8e930f562086cbb0c770a2..07ca3ea457db6a583f9ca01ab231747fa95b039a 100644 (file)
@@ -11,7 +11,7 @@ Distributed under the GPL
 #include <msp/gltk/dropdown.h>
 #include "toolbar.h"
 
-class Routebar: public Toolbar
+class Routebar: public Toolbar, public sigc::trackable
 {
 private:
        Designer &designer;
index ded63ad6a8e81da7e94cd839215f5e267162969e..c9a7580c3921650246cd6f782918518de8efe926 100644 (file)
@@ -13,7 +13,7 @@ Distributed under the GPL
 
 class Designer;
 
-class Zonebar: public Toolbar
+class Zonebar: public Toolbar, public sigc::trackable
 {
 private:
        Designer &designer;
index a55819bdb3db2763abc7825a8b6fc6121fbac426..cbe226a684c31ffcf6229fd5d1ead978530ae269 100644 (file)
@@ -53,6 +53,8 @@ Layout::~Layout()
                delete trains.begin()->second;
        while(!routes.empty())
                delete *routes.begin();
+       while(!zones.empty())
+               delete *zones.begin();
        while(!tracks.empty())
                delete *tracks.begin();
        while(!blocks.empty())