From 3221218b4d31aa1eb2943ae07e48ef92623bcef8 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 10 Oct 2014 20:52:01 +0200 Subject: lpf-trip-part: don't fail finalize on incompletely initialized objects --- libplanfahr/lpf-trip-part.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libplanfahr/lpf-trip-part.c b/libplanfahr/lpf-trip-part.c index 09ed920..71658d2 100644 --- a/libplanfahr/lpf-trip-part.c +++ b/libplanfahr/lpf-trip-part.c @@ -193,8 +193,10 @@ lpf_trip_part_finalize (GObject *object) LpfTripPartPrivate *priv = GET_PRIVATE (self); GObjectClass *parent_class = G_OBJECT_CLASS (lpf_trip_part_parent_class); - g_object_unref (priv->start); - g_object_unref (priv->end); + if (priv->start) + g_object_unref (priv->start); + if (priv->end) + g_object_unref (priv->end); g_slist_free_full (priv->stops, g_object_unref); g_free (priv->line); -- cgit v1.2.3