]> Pileus Git - ~andy/gtk/commitdiff
Fix a memory leak
authorMatthias Clasen <mclasen@redhat.com>
Tue, 7 Aug 2012 03:37:36 +0000 (23:37 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 7 Aug 2012 03:37:36 +0000 (23:37 -0400)
As Pavel Vesin pointed out in bug 681064, we were leaking
the container_restyle_queue.

gtk/gtkcontainer.c

index be686027886eb59904fe041c36990632262847d5..ad8ccb56579eb58fa883e8614a7ae18a67f3a90c 100644 (file)
@@ -1648,14 +1648,18 @@ gtk_container_idle_sizer (gpointer data)
   current_time = g_get_monotonic_time ();
   slist = container_restyle_queue;
   container_restyle_queue = NULL;
-  for (; slist; slist = slist->next)
+  while (slist)
     {
+      GSList *next = slist->next;
       GtkContainer *container = slist->data;
 
       container->priv->restyle_pending = FALSE;
       _gtk_style_context_validate (gtk_widget_get_style_context (GTK_WIDGET (container)),
                                    current_time,
                                    0);
+
+      g_slist_free_1 (slist);
+      slist = next;
     }
 
   /* we may be invoked with a container_resize_queue of NULL, because