From dac56109f3f34616ce6fdacf456ec9763d871322 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 16 Aug 2011 07:08:36 +0200 Subject: Fix large memory leaks in the swatches panel (bzr r10347.1.35) --- src/ege-select-one-action.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ege-select-one-action.cpp') diff --git a/src/ege-select-one-action.cpp b/src/ege-select-one-action.cpp index e0130a68d..44b3dc465 100644 --- a/src/ege-select-one-action.cpp +++ b/src/ege-select-one-action.cpp @@ -52,6 +52,7 @@ enum { static void ege_select_one_action_class_init( EgeSelectOneActionClass* klass ); static void ege_select_one_action_init( EgeSelectOneAction* action ); +static void ege_select_one_action_finalize( GObject* action ); static void ege_select_one_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec ); static void ege_select_one_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec ); @@ -159,6 +160,7 @@ void ege_select_one_action_class_init( EgeSelectOneActionClass* klass ) gDataName = g_quark_from_string("ege-select1-action"); + objClass->finalize = ege_select_one_action_finalize; objClass->get_property = ege_select_one_action_get_property; objClass->set_property = ege_select_one_action_set_property; @@ -282,6 +284,19 @@ void ege_select_one_action_init( EgeSelectOneAction* action ) /* g_signal_connect( action, "notify", G_CALLBACK( fixup_labels ), NULL ); */ } +void ege_select_one_action_finalize( GObject* object ) +{ + EgeSelectOneAction *action = EGE_SELECT_ONE_ACTION( object ); + + g_free( action->private_data->iconProperty ); + g_free( action->private_data->appearance ); + g_free( action->private_data->selection ); + + if ( G_OBJECT_CLASS(gParentClass)->finalize ) { + (*G_OBJECT_CLASS(gParentClass)->finalize)(object); + } +} + EgeSelectOneAction* ege_select_one_action_new( const gchar *name, const gchar *label, const gchar *tooltip, -- cgit v1.2.3