From 1f5c6abed9974c4fa9ce01d216c57a7bcde088e8 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 5 Oct 2014 09:14:53 +0200 Subject: Don't leak trips --- src/uplanfahrtripview.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/uplanfahrtripview.c') diff --git a/src/uplanfahrtripview.c b/src/uplanfahrtripview.c index 7e6306b..a24b04d 100644 --- a/src/uplanfahrtripview.c +++ b/src/uplanfahrtripview.c @@ -90,7 +90,7 @@ u_plan_fahr_trip_view_store_trips (UPlanFahrTripView *self, GSList *trips) UPlanFahrTripViewPrivate *priv; GtkTreeIter iter; - GSList *parts; + GSList *parts, *trip; LpfTrip *tripobj; LpfTripPart *firstpart, *lastpart; LpfStop *start, *end; @@ -102,8 +102,8 @@ u_plan_fahr_trip_view_store_trips (UPlanFahrTripView *self, GSList *trips) priv = u_plan_fahr_trip_view_get_instance_private (U_PLAN_FAHR_TRIP_VIEW (self)); gtk_list_store_clear (priv->liststore); - for (; trips; trips = g_slist_next (trips)) { - tripobj = trips->data; + for (trip = trips; trip; trip = g_slist_next (trip)) { + tripobj = trip->data; g_object_get(tripobj, "parts", &parts, NULL); firstpart = LPF_TRIP_PART(parts->data); @@ -154,4 +154,5 @@ u_plan_fahr_trip_view_store_trips (UPlanFahrTripView *self, GSList *trips) g_free (dep_delay); g_free (arr_delay); } + g_slist_free_full (trips, g_object_unref); } -- cgit v1.2.3