ClutterActor *group, *actor;
actor = champlain_tile_get_actor (tile);
group = champlain_zoom_level_get_actor (map->current_level);
- champlain_zoom_level_remove_tile (map->current_level, tile);
- g_object_unref (tile);
clutter_container_remove_actor (CLUTTER_CONTAINER (group), actor);
+ champlain_zoom_level_remove_tile (map->current_level, tile);
}
}
g_object_set (G_OBJECT (tile), "x", i, "y", j, NULL);
champlain_map_source_get_tile (source, view, map->current_level, tile);
champlain_zoom_level_add_tile (map->current_level, tile);
+ g_object_unref (tile);
}
}
}
ChamplainTilePrivate *priv = GET_PRIVATE (self);
+ if (priv->actor != NULL)
+ g_object_unref (priv->actor);
+
priv->actor = g_object_ref (actor);
g_object_notify (G_OBJECT (self), "actor");
}
champlain_zoom_level_dispose (GObject *object)
{
//FIXME: Get rid of tiles here?
+ guint k;
ChamplainZoomLevelPrivate *priv = GET_PRIVATE (object);
+ ChamplainZoomLevel *level = CHAMPLAIN_ZOOM_LEVEL (object);
g_object_unref (priv->actor);
+ // Get rid of old tiles first
+ for (k = 0; k < champlain_zoom_level_tile_count (level); k++)
+ {
+ ChamplainTile *tile = champlain_zoom_level_get_nth_tile (level, k);
+ champlain_zoom_level_remove_tile (level, tile);
+ }
+
G_OBJECT_CLASS (champlain_zoom_level_parent_class)->dispose (object);
}
ChamplainZoomLevelPrivate *priv = GET_PRIVATE (self);
+ g_object_ref (tile);
g_ptr_array_add (priv->tiles, tile);
g_signal_emit (self, signals[SIGNAL_TILE_ADDED], 0, tile);
}
g_signal_emit (self, signals[SIGNAL_TILE_REMOVED], 0, tile);
g_ptr_array_remove_fast (priv->tiles, tile);
+ g_object_unref (tile);
}
guint