diff options
author | Matthias Clasen <maclas@gmx.de> | 2004-03-12 23:23:28 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-03-12 23:23:28 +0000 |
commit | 60780dc68dfd9347f8f3b1cae2e0544361ca8b05 (patch) | |
tree | e9eb4a6f9c381c35f81acf8929e1bfa6389a92fc /gtk | |
parent | 8ac29f38181e58fdf7c2bd3cd6f5de0f5004ca3d (diff) | |
download | gdk-pixbuf-60780dc68dfd9347f8f3b1cae2e0544361ca8b05.tar.gz |
Keep the cell_list in a consistent state while iterating over it, since
Sat Mar 13 00:07:51 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_layout_clear):
Keep the cell_list in a consistent state while iterating over it,
since clear_attributes() also iterates over it. (another instance
of #136585, Morten Welinder)
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktreeviewcolumn.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 88c299f93..97da32019 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -663,17 +663,16 @@ gtk_tree_view_column_cell_layout_clear (GtkCellLayout *cell_layout) g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (cell_layout)); column = GTK_TREE_VIEW_COLUMN (cell_layout); - for (list = column->cell_list; list; list = list->next) + while (column->cell_list) { - GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)list->data; + GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)column->cell_list->data; - gtk_tree_view_column_clear_attributes (column, info->cell); - g_object_unref (info->cell); + gtk_tree_view_column_cell_layout_clear_attributes (cell_layout, info->cell); + g_object_unref (G_OBJECT (info->cell)); g_free (info); + column->cell_list = g_list_delete_link (column->cell_list, + column->cell_list); } - - g_list_free (column->cell_list); - column->cell_list = NULL; } static void |