From 62c8174bac8139b29a71ea79c879c4cbdd6cd064 Mon Sep 17 00:00:00 2001 From: NotZed Date: Thu, 11 May 2000 18:39:11 +0000 Subject: Destroy the g_scanner when cleaning up. (e_sexp_finalise): Free symbol 2000-05-11 NotZed * e-sexp.c (e_sexp_finalise): Destroy the g_scanner when cleaning up. (e_sexp_finalise): Free symbol table on finalise. svn path=/trunk/; revision=2988 --- e-util/ChangeLog | 5 +++++ e-util/e-sexp.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index a4d3beeaae..367885919f 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2000-05-11 NotZed + + * e-sexp.c (e_sexp_finalise): Destroy the g_scanner when cleaning up. + (e_sexp_finalise): Free symbol table on finalise. + 2000-05-09 Christopher James Lahey * e-canvas.c: Remove reflow idle when being destroyed. diff --git a/e-util/e-sexp.c b/e-util/e-sexp.c index 0f9abc636a..7d7b5f5f0f 100644 --- a/e-util/e-sexp.c +++ b/e-util/e-sexp.c @@ -902,6 +902,15 @@ static struct { { "begin", (ESExpFunc *)term_eval_begin, 1 }, }; +static void +free_symbol(void *key, void *value, void *data) +{ + struct _ESExpSymbol *s = value; + + g_free(s->name); + g_free(s); +} + static void e_sexp_finalise(GtkObject *o) { @@ -912,6 +921,9 @@ e_sexp_finalise(GtkObject *o) s->tree = NULL; } + g_scanner_scope_foreach_symbol(s->scanner, 0, free_symbol, 0); + g_scanner_destroy(s->scanner); + ((GtkObjectClass *)(parent_class))->finalize((GtkObject *)o); } -- cgit v1.2.3