From bbfda4227e6790fa945368cb5d4cb3d24e4da3d7 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 8 Aug 2001 09:39:56 +0000 Subject: Properly free the list of parts, and the private data. 2001-08-07 Not Zed * filter-rule.c (filter_rule_finalise): Properly free the list of parts, and the private data. (FilterRulePrivate): Remove unused 'parts' member. * filter-option.c (free_option): For freeing options. (filter_option_finalise): Free options list. * filter-element.c (filter_element_finalise): free name. * filter-input.c (filter_input_finalise): Free type and values list. * filter-context.c (filter_context_finalise): Free the actions. * rule-context.c (rule_context_finalise): Remove the totally weird arsed *_set_list free code. (free_part_set): (free_rule_set): Use this to free stuff using g_list_foreach. (rule_context_finalise): Free the error string. (rule_context_finalise): Free the rules and parts. svn path=/trunk/; revision=11774 --- filter/filter-option.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'filter/filter-option.c') diff --git a/filter/filter-option.c b/filter/filter-option.c index 5167a3df9b..9648bc36a0 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -112,12 +112,22 @@ filter_option_init (FilterOption *o) o->priv = g_malloc0 (sizeof (*o->priv)); } +static void +free_option(struct _filter_option *o, void *data) +{ + g_free(o->title); + g_free(o->value); + g_free(o->code); + g_free(o); +} + static void filter_option_finalise (GtkObject *obj) { FilterOption *o = (FilterOption *)obj; - - o = o; + + g_list_foreach(o->options, (GFunc)free_option, NULL); + g_list_free(o->options); ((GtkObjectClass *)(parent_class))->finalize(obj); } -- cgit