aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-10-10 20:52:01 +0200
committerGuido Günther <agx@sigxcpu.org>2014-10-10 20:52:52 +0200
commit3221218b4d31aa1eb2943ae07e48ef92623bcef8 (patch)
treed562d1e9a4f42d886bf0d10b974b23fa117d5cf3
parentdc3dd87cdaf9592dad9af8ef0ecbc7beae2d345e (diff)
lpf-trip-part: don't fail finalize on incompletely initialized objects
-rw-r--r--libplanfahr/lpf-trip-part.c6
1 files 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);