]> err.no Git - libchamplain/commitdiff
Memory leak fix: priv->uri and priv->filename.
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Wed, 22 Apr 2009 21:04:11 +0000 (23:04 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 22 Apr 2009 22:14:25 +0000 (18:14 -0400)
The constructor is now affecting default values to the
properties through "priv".

champlain/champlain-tile.c

index adc1336f37dd9c030d670505cf5011524e7c814e..0c928beb5121658d0507388997810f4a0a63a68a 100644 (file)
@@ -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;
 }