diff finch/libgnt/gntbutton.c @ 21278:ebb46dea479a

Buttons were leaking all this time! It's a good thing there ain't too many of them in finch!
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 31 Oct 2007 18:13:53 +0000
parents 9187d331aebe
children 0ba0f2804299
line wrap: on
line diff
--- a/finch/libgnt/gntbutton.c	Tue Oct 30 10:50:20 2007 +0000
+++ b/finch/libgnt/gntbutton.c	Wed Oct 31 18:13:53 2007 +0000
@@ -98,6 +98,14 @@
 }
 
 static void
+gnt_button_destroy(GntWidget *widget)
+{
+	GntButton *button = GNT_BUTTON(widget);
+	g_free(button->priv->text);
+	g_free(button->priv);
+}
+
+static void
 gnt_button_class_init(GntWidgetClass *klass)
 {
 	char *style;
@@ -108,6 +116,7 @@
 	parent_class->size_request = gnt_button_size_request;
 	parent_class->key_pressed = gnt_button_key_pressed;
 	parent_class->clicked = gnt_button_clicked;
+	parent_class->destroy = gnt_button_destroy;
 
 	style = gnt_style_get_from_name(NULL, "small-button");
 	small_button = gnt_style_parse_bool(style);