From 9638db32e637fc97a9e5a395db5278baaf74e6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Thu, 25 Dec 2014 18:47:04 -0500 Subject: [PATCH] date-selector: fix memory leak --- src/gcal-date-selector.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gcal-date-selector.c b/src/gcal-date-selector.c index fbf1657a..37263d5a 100644 --- a/src/gcal-date-selector.c +++ b/src/gcal-date-selector.c @@ -291,7 +291,7 @@ gcal_date_selector_constructed (GObject *object) GcalDateSelectorPrivate *priv; GtkWidget *label, *box; - GList *l; + GList *l, *aux; priv = gcal_date_selector_get_instance_private (GCAL_DATE_SELECTOR (object)); @@ -308,7 +308,8 @@ gcal_date_selector_constructed (GObject *object) /* retrieve components from UI definition: entries */ box = gtk_grid_get_child_at (GTK_GRID (priv->grid), 0, 1); - for (l = gtk_container_get_children (GTK_CONTAINER (box)); l != NULL; l = g_list_next (l)) + aux = gtk_container_get_children (GTK_CONTAINER (box)); + for (l = aux; l != NULL; l = g_list_next (l)) { gint position; gtk_container_child_get (GTK_CONTAINER (box), l->data, "position", &position, NULL); @@ -322,6 +323,7 @@ gcal_date_selector_constructed (GObject *object) if (position == priv->day_pos || position == priv->month_pos) gtk_entry_set_max_length (GTK_ENTRY (l->data), 2); } + g_list_free (aux); } /* Public API */