[gtk+/gtk-2-18] Fix a memory leak in gtk_label_compose_effective_attrs()



commit eeaeb015902eef6df7a20e1fe4dd939bf024e2b6
Author: Jonh Wendell <jwendell gnome org>
Date:   Tue Dec 22 11:18:05 2009 -0300

    Fix a memory leak in gtk_label_compose_effective_attrs()

 gtk/gtklabel.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index acf7f53..62dba19 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1750,17 +1750,20 @@ gtk_label_compose_effective_attrs (GtkLabel *label)
       if (label->effective_attrs)
 	{
 	  if ((iter = pango_attr_list_get_iterator (label->attrs)))
-	    do 
-	      {
-		iter_attrs = pango_attr_iterator_get_attrs (iter);
-		for (l = iter_attrs; l; l = l->next)
-		  {
-		    attr = l->data;
-		    pango_attr_list_insert (label->effective_attrs, attr);
-		  }
-		g_slist_free (iter_attrs);
-	      }
-	    while (pango_attr_iterator_next (iter));
+	    {
+	      do
+		{
+		  iter_attrs = pango_attr_iterator_get_attrs (iter);
+		  for (l = iter_attrs; l; l = l->next)
+		    {
+		      attr = l->data;
+		      pango_attr_list_insert (label->effective_attrs, attr);
+		    }
+		  g_slist_free (iter_attrs);
+	        }
+	      while (pango_attr_iterator_next (iter));
+	      pango_attr_iterator_destroy (iter);
+	    }
 	}
       else
 	label->effective_attrs = 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]