From: Emmanuel Rodriguez Date: Wed, 22 Apr 2009 21:04:11 +0000 (+0200) Subject: Memory leak fix: priv->uri and priv->filename. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f0bce819d168e86d487d9af4c304d242bec01cd;p=libchamplain Memory leak fix: priv->uri and priv->filename. The constructor is now affecting default values to the properties through "priv". --- diff --git a/champlain/champlain-tile.c b/champlain/champlain-tile.c index adc1336..0c928be 100644 --- a/champlain/champlain-tile.c +++ b/champlain/champlain-tile.c @@ -249,16 +249,17 @@ champlain_tile_class_init (ChamplainTileClass *klass) static void champlain_tile_init (ChamplainTile *self) { - champlain_tile_set_state (self, CHAMPLAIN_STATE_INIT); - champlain_tile_set_x (self, 0); - champlain_tile_set_y (self, 0); - champlain_tile_set_zoom_level (self, 0); - champlain_tile_set_size (self, 0); - champlain_tile_set_uri (self, g_strdup ("")); - champlain_tile_set_filename (self, g_strdup ("")); + ChamplainTilePrivate *priv = GET_PRIVATE (self); + + priv->state = CHAMPLAIN_STATE_INIT; + priv->x = 0; + priv->y = 0; + priv->zoom_level = 0; + priv->size = 0; + priv->uri = g_strdup (""); + priv->filename = g_strdup (""); /* Can't call champlain_tile_set_actor (self, NULL); because the assertion will fail */ - ChamplainTilePrivate *priv = GET_PRIVATE (self); priv->actor = NULL; }