From 40724e3bca671cf97542cd6fbad00e3953a235c3 Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Mon, 13 May 2013 21:11:21 +0100 Subject: [PATCH] -Fixed small memory leak in gtrack --- src/gtrack.hxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gtrack.hxx b/src/gtrack.hxx index 2db2e39..e33e665 100644 --- a/src/gtrack.hxx +++ b/src/gtrack.hxx @@ -15,7 +15,8 @@ class GTrack : public Fl_Group public: GTrack(int x, int y, int w, int h, const char* l = 0 ) : Fl_Group(x, y, w, h), - bg( x, y , w, h, strdup(l) ), + title( strdup(l) ), + bg( x, y , w, h, title ), button1(x + 5, y + 24, 18, 18,"1"), button2(x + 5, y + 44, 18, 18,"2"), @@ -31,8 +32,15 @@ class GTrack : public Fl_Group end(); // close the group } + ~GTrack() + { + free(title); + } + private: + char* title; + Avtk::Background bg; Avtk::Button button1; @@ -46,6 +54,7 @@ class GTrack : public Fl_Group Avtk::Dial dial2; Avtk::Dial dial3; + static int privateID; };