]> err.no Git - libchamplain/commitdiff
Fix actor's reference counting in ChamplainTile
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 23 Mar 2009 21:25:00 +0000 (23:25 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 23 Mar 2009 21:25:00 +0000 (23:25 +0200)
champlain/champlain-tile.c

index 4bc6b5c5641efe546bf0f1cc6f96c3beaebfa72e..99fe5fdebe961d071ecada586e75dd3ea162694d 100644 (file)
@@ -142,8 +142,13 @@ champlain_tile_dispose (GObject *object)
 {
   ChamplainTilePrivate *priv = GET_PRIVATE (object);
 
+  g_free (priv->uri);
+  g_free (priv->filename);
   if (priv->actor != NULL)
-    priv->actor = NULL;
+    {
+      g_object_unref (G_OBJECT (priv->actor));
+      priv->actor = NULL;
+    }
 
   G_OBJECT_CLASS (champlain_tile_parent_class)->dispose (object);
 }
@@ -151,13 +156,6 @@ champlain_tile_dispose (GObject *object)
 static void
 champlain_tile_finalize (GObject *object)
 {
-  ChamplainTilePrivate *priv = GET_PRIVATE (object);
-
-  g_free (priv->uri);
-  g_free (priv->filename);
-  if (priv->actor != NULL)
-    g_object_unref (G_OBJECT (priv->actor));
-
   G_OBJECT_CLASS (champlain_tile_parent_class)->finalize (object);
 }