-Fixed small memory leak in gtrack

This commit is contained in:
Harry van Haaren 2013-05-13 21:11:21 +01:00
parent 24b23a1d9f
commit 40724e3bca

View file

@ -15,7 +15,8 @@ class GTrack : public Fl_Group
public: public:
GTrack(int x, int y, int w, int h, const char* l = 0 ) : GTrack(int x, int y, int w, int h, const char* l = 0 ) :
Fl_Group(x, y, w, h), 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"), button1(x + 5, y + 24, 18, 18,"1"),
button2(x + 5, y + 44, 18, 18,"2"), button2(x + 5, y + 44, 18, 18,"2"),
@ -31,8 +32,15 @@ class GTrack : public Fl_Group
end(); // close the group end(); // close the group
} }
~GTrack()
{
free(title);
}
private: private:
char* title;
Avtk::Background bg; Avtk::Background bg;
Avtk::Button button1; Avtk::Button button1;
@ -46,6 +54,7 @@ class GTrack : public Fl_Group
Avtk::Dial dial2; Avtk::Dial dial2;
Avtk::Dial dial3; Avtk::Dial dial3;
static int privateID; static int privateID;
}; };