aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-10-05 09:14:53 +0200
committerGuido Günther <agx@sigxcpu.org>2014-10-05 09:14:53 +0200
commit1f5c6abed9974c4fa9ce01d216c57a7bcde088e8 (patch)
treeee4f75a9766f9a446c2995776d67c5ba21fee3d1
parent5758e07ce31e889041dd4d115ab9092008875e61 (diff)
Don't leak trips
-rw-r--r--src/uplanfahrtripview.c7
1 files changed, 4 insertions, 3 deletions
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);
}