From b2623d4922882af63dd0394511d5fb7072ff31d8 Mon Sep 17 00:00:00 2001 From: Thomas Thurman Date: Sun, 30 Aug 2009 16:32:45 -0400 Subject: [PATCH] fix memory leak --- TODO | 1 - belltower.c | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 03d8ff2..35a8dc4 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ -* Fix memory leak * Window name on tower pick lists * Sharp and flat signs * Add my name to the credits list diff --git a/belltower.c b/belltower.c index 0406988..f571278 100644 --- a/belltower.c +++ b/belltower.c @@ -807,6 +807,20 @@ show_tower (char *primary_key) } static void +free_tower_list (GSList *list) +{ + GSList *cursor = list; + + while (cursor) + { + found_tower_free ((FoundTower*) cursor->data); + cursor = cursor->next; + } + + g_slist_free (list); +} + +static void show_towers_from_list (GSList *list) { GtkWidget *dialog; @@ -833,7 +847,7 @@ show_towers_from_list (GSList *list) "One tower found."); show_tower (found->primarykey); - /* FIXME: and free the list */ + free_tower_list (list); return; } @@ -870,7 +884,7 @@ show_towers_from_list (GSList *list) show_tower (found->primarykey); } - /* FIXME: and free the list */ + free_tower_list (list); } static gint strcmp_f (gconstpointer a, -- 1.7.9.5