champlain_tile_dispose (GObject *object)
{
ChamplainTilePrivate *priv = GET_PRIVATE (object);
- /* We call destroy here as an actor should not survive its tile */
+
if (priv->actor != NULL)
- clutter_actor_destroy (priv->actor);
+ priv->actor = NULL;
G_OBJECT_CLASS (champlain_tile_parent_class)->dispose (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);
}
champlain_tile_set_y (self, 0);
champlain_tile_set_zoom_level (self, 0);
champlain_tile_set_size (self, 0);
- champlain_tile_set_uri (self, "");
- champlain_tile_set_filename (self, "");
+ champlain_tile_set_uri (self, g_strdup (""));
+ champlain_tile_set_filename (self, g_strdup (""));
+
+ /* Can't call champlain_tile_set_actor (self, NULL); because the assertion will fail */
+ ChamplainTilePrivate *priv = GET_PRIVATE (self);
+ priv->actor = NULL;
}
ChamplainTile*
return priv->state;
}
-const gchar *
+G_CONST_RETURN gchar *
champlain_tile_get_uri (ChamplainTile *self)
{
g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL);
return priv->uri;
}
-const gchar *
+G_CONST_RETURN gchar *
champlain_tile_get_filename (ChamplainTile *self)
{
g_return_val_if_fail(CHAMPLAIN_TILE(self), NULL);
gint champlain_tile_get_zoom_level (ChamplainTile *self);
guint champlain_tile_get_size (ChamplainTile *self);
ChamplainState champlain_tile_get_state (ChamplainTile *self);
-const gchar * champlain_tile_get_uri (ChamplainTile *self);
-const gchar * champlain_tile_get_filename (ChamplainTile *self);
+G_CONST_RETURN gchar * champlain_tile_get_uri (ChamplainTile *self);
+G_CONST_RETURN gchar * champlain_tile_get_filename (ChamplainTile *self);
ClutterActor * champlain_tile_get_actor (ChamplainTile *self);
void champlain_tile_set_x (ChamplainTile *self, gint x);