diff options
Diffstat (limited to 'e-util/e-sexp.c')
-rw-r--r-- | e-util/e-sexp.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/e-util/e-sexp.c b/e-util/e-sexp.c index ad36c368bf..0f9abc636a 100644 --- a/e-util/e-sexp.c +++ b/e-util/e-sexp.c @@ -869,12 +869,17 @@ camel_mbox_folder_search_by_expression(CamelFolder *folder, char *expression, Ca #endif +static void e_sexp_finalise(GtkObject *); + static void e_sexp_class_init (ESExpClass *class) { GtkObjectClass *object_class; object_class = (GtkObjectClass *) class; + + object_class->finalize = e_sexp_finalise; + parent_class = gtk_type_class (gtk_object_get_type ()); } @@ -898,6 +903,19 @@ static struct { }; static void +e_sexp_finalise(GtkObject *o) +{ + ESExp *s = (ESExp *)o; + + if (s->tree) { + parse_term_free(s->tree); + s->tree = NULL; + } + + ((GtkObjectClass *)(parent_class))->finalize((GtkObject *)o); +} + +static void e_sexp_init (ESExp *s) { int i; @@ -1041,6 +1059,9 @@ e_sexp_parse(ESExp *f) { g_return_if_fail(FILTER_IS_SEXP(f)); + if (f->tree) + parse_term_free(f->tree); + f->tree = parse_list(f, FALSE); if (f->tree) |