From: Mikko Rasa Date: Tue, 23 Nov 2010 05:42:12 +0000 (+0000) Subject: Fix valgrind errors X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4e406ca29b1bb87a8e20324e5cf54f5b5de6afb8;p=r2c2.git Fix valgrind errors --- diff --git a/source/designer/designer.cpp b/source/designer/designer.cpp index 5f125fd..5974816 100644 --- a/source/designer/designer.cpp +++ b/source/designer/designer.cpp @@ -164,6 +164,8 @@ Designer::Designer(int argc, char **argv): Designer::~Designer() { + for(vector::iterator i=toolbars.begin(); i!=toolbars.end(); ++i) + delete *i; delete overlay; delete pipeline; delete base_object; diff --git a/source/designer/routebar.h b/source/designer/routebar.h index 005b004..07ca3ea 100644 --- a/source/designer/routebar.h +++ b/source/designer/routebar.h @@ -11,7 +11,7 @@ Distributed under the GPL #include #include "toolbar.h" -class Routebar: public Toolbar +class Routebar: public Toolbar, public sigc::trackable { private: Designer &designer; diff --git a/source/designer/zonebar.h b/source/designer/zonebar.h index ded63ad..c9a7580 100644 --- a/source/designer/zonebar.h +++ b/source/designer/zonebar.h @@ -13,7 +13,7 @@ Distributed under the GPL class Designer; -class Zonebar: public Toolbar +class Zonebar: public Toolbar, public sigc::trackable { private: Designer &designer; diff --git a/source/libr2c2/layout.cpp b/source/libr2c2/layout.cpp index a55819b..cbe226a 100644 --- a/source/libr2c2/layout.cpp +++ b/source/libr2c2/layout.cpp @@ -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())