From d22cf5141ec1fc6e9ee1b26ea5fb40900dcb3874 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 19 Sep 2008 04:43:01 +0000 Subject: [PATCH] Plug a memory leak svn path=/trunk/; revision=21439 --- modules/other/gail/ChangeLog | 5 +++++ modules/other/gail/gailtreeview.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/other/gail/ChangeLog b/modules/other/gail/ChangeLog index ee0ebb8116..e7a1b7c194 100644 --- a/modules/other/gail/ChangeLog +++ b/modules/other/gail/ChangeLog @@ -1,3 +1,8 @@ +2008-09-19 Matthias Clasen + + * gailtreeview.c (garbage_collect_cell_data): Actually free + the copied list. + 2008-08-21 Li Yuan * gailtreeview.c: (traverse_cells): diff --git a/modules/other/gail/gailtreeview.c b/modules/other/gail/gailtreeview.c index 4e5e338d25..6d6dc65395 100644 --- a/modules/other/gail/gailtreeview.c +++ b/modules/other/gail/gailtreeview.c @@ -3667,12 +3667,12 @@ static gboolean garbage_collect_cell_data (gpointer data) { GailTreeView *tree_view; - GList *temp_list; + GList *temp_list, *list; GailTreeViewCellInfo *cell_info; g_assert (GAIL_IS_TREE_VIEW (data)); tree_view = (GailTreeView *)data; - temp_list = g_list_copy (tree_view->cell_data); + list = g_list_copy (tree_view->cell_data); tree_view->garbage_collection_pending = FALSE; if (tree_view->idle_garbage_collect_id != 0) @@ -3682,6 +3682,7 @@ garbage_collect_cell_data (gpointer data) } /* Must loop through them all */ + temp_list = list; while (temp_list != NULL) { cell_info = temp_list->data; @@ -3696,7 +3697,7 @@ garbage_collect_cell_data (gpointer data) } temp_list = temp_list->next; } - g_list_free (temp_list); + g_list_free (list); return tree_view->garbage_collection_pending; }