]> Pileus Git - ~andy/gtk/commitdiff
Actually free the lists. Pointed out by Morten Welinder.
authorMatthias Clasen <maclas@gmx.de>
Fri, 6 Feb 2004 22:25:01 +0000 (22:25 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 6 Feb 2004 22:25:01 +0000 (22:25 +0000)
Fri Feb  6 23:08:29 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtktextbtree.c (_gtk_text_btree_check):
* gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear_attributes):
* gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes):
Actually free the lists. Pointed out by Morten Welinder.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcellview.c
gtk/gtkcombobox.c
gtk/gtktextbtree.c

index 95158a9d03d0e330c3e200ef1c07afd71be2c4f1..170ea80b4fa98fee6745d63d86ddc4f1e0952d98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
-Fri Feb  6 22:56:05 2004  Matthias Clasen  <maclas@gmx.de>
+Fri Feb  6 23:08:29 2004  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtktextbtree.c (_gtk_text_btree_check): 
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear_attributes): 
        * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): 
        Actually free the lists. Pointed out by Morten Welinder.
index 95158a9d03d0e330c3e200ef1c07afd71be2c4f1..170ea80b4fa98fee6745d63d86ddc4f1e0952d98 100644 (file)
@@ -1,5 +1,6 @@
-Fri Feb  6 22:56:05 2004  Matthias Clasen  <maclas@gmx.de>
+Fri Feb  6 23:08:29 2004  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtktextbtree.c (_gtk_text_btree_check): 
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear_attributes): 
        * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): 
        Actually free the lists. Pointed out by Morten Welinder.
index 95158a9d03d0e330c3e200ef1c07afd71be2c4f1..170ea80b4fa98fee6745d63d86ddc4f1e0952d98 100644 (file)
@@ -1,5 +1,6 @@
-Fri Feb  6 22:56:05 2004  Matthias Clasen  <maclas@gmx.de>
+Fri Feb  6 23:08:29 2004  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtktextbtree.c (_gtk_text_btree_check): 
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear_attributes): 
        * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): 
        Actually free the lists. Pointed out by Morten Welinder.
index 95158a9d03d0e330c3e200ef1c07afd71be2c4f1..170ea80b4fa98fee6745d63d86ddc4f1e0952d98 100644 (file)
@@ -1,5 +1,6 @@
-Fri Feb  6 22:56:05 2004  Matthias Clasen  <maclas@gmx.de>
+Fri Feb  6 23:08:29 2004  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtktextbtree.c (_gtk_text_btree_check): 
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear_attributes): 
        * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): 
        Actually free the lists. Pointed out by Morten Welinder.
index 95158a9d03d0e330c3e200ef1c07afd71be2c4f1..170ea80b4fa98fee6745d63d86ddc4f1e0952d98 100644 (file)
@@ -1,5 +1,6 @@
-Fri Feb  6 22:56:05 2004  Matthias Clasen  <maclas@gmx.de>
+Fri Feb  6 23:08:29 2004  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtktextbtree.c (_gtk_text_btree_check): 
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_clear_attributes): 
        * gtk/gtkcellview.c (gtk_cell_view_cell_layout_clear_attributes): 
        Actually free the lists. Pointed out by Morten Welinder.
index 3ebd912a9d691bf44c5c2a18540b8f2119c2a60b..f7bb9dcba48a690913ec3bf4233c7c789a444d82 100644 (file)
@@ -682,7 +682,6 @@ gtk_cell_view_cell_layout_clear_attributes (GtkCellLayout   *layout,
 {
   GtkCellViewCellInfo *info;
   GtkCellView *cellview = GTK_CELL_VIEW (layout);
-  GSList *list;
 
   g_return_if_fail (GTK_IS_CELL_VIEW (cellview));
   g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));
@@ -690,15 +689,8 @@ gtk_cell_view_cell_layout_clear_attributes (GtkCellLayout   *layout,
   info = gtk_cell_view_get_cell_info (cellview, renderer);
   g_return_if_fail (info != NULL);
 
-  list = info->attributes;
-
-  while (list && list->next)
-    {
-      g_free (list->data);
-      list = list->next->next;
-    }
-  g_slist_free (list);
-
+  g_slist_foreach (info->attributes, (GFunc)g_free, NULL);
+  g_slist_free (info->attributes);
   info->attributes = NULL;
 }
 
index 2534ac84ed52badff6b1957cbfe4a2d4af4ff312..eb1918c40c86bb345405069c8c5c409451c653c6 100644 (file)
@@ -2258,7 +2258,6 @@ gtk_combo_box_cell_layout_clear_attributes (GtkCellLayout   *layout,
   ComboCellInfo *info;
   GtkComboBox *combo_box = GTK_COMBO_BOX (layout);
   GtkWidget *menu;
-  GSList *list;
 
   g_return_if_fail (GTK_IS_COMBO_BOX (layout));
   g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
@@ -2266,14 +2265,8 @@ gtk_combo_box_cell_layout_clear_attributes (GtkCellLayout   *layout,
   info = gtk_combo_box_get_cell_info (combo_box, cell);
   g_return_if_fail (info != NULL);
 
-  list = info->attributes;
-  while (list && list->next)
-    {
-      g_free (list->data);
-      list = list->next->next;
-    }
-  g_slist_free (list);
-
+  g_slist_foreach (info->attributes, (GFunc)g_free, NULL);
+  g_slist_free (info->attributes);
   info->attributes = NULL;
 
   if (combo_box->priv->cell_view)
index f9c08fe1130890d3bf16524287cbb48948948b1f..6d340a74aedca8bc9fabd81771aeb0f354c799ed 100644 (file)
@@ -6698,15 +6698,15 @@ _gtk_text_btree_check (GtkTextBTree *tree)
   GtkTextLine *line;
   GtkTextLineSegment *seg;
   GtkTextTag *tag;
-  GSList *taglist = NULL;
+  GSList *all_tags, *taglist = NULL;
   int count;
   GtkTextTagInfo *info;
 
   /*
    * Make sure that the tag toggle counts and the tag root pointers are OK.
    */
-  for (taglist = list_of_tags (tree->table);
-       taglist != NULL ; taglist = taglist->next)
+  all_tags = list_of_tags (tree->table);
+  for (taglist = all_tags; taglist != NULL ; taglist = taglist->next)
     {
       tag = taglist->data;
       info = gtk_text_btree_get_existing_tag_info (tree, tag);
@@ -6790,8 +6790,7 @@ _gtk_text_btree_check (GtkTextBTree *tree)
         }
     }
 
-  g_slist_free (taglist);
-  taglist = NULL;
+  g_slist_free (all_tags);
 
   /*
    * Call a recursive procedure to do the main body of checks.