]> err.no Git - libchamplain/commitdiff
Fix a memory bug in champlain_polygon_clear_points()
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Wed, 29 Jul 2009 20:26:05 +0000 (22:26 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 31 Jul 2009 21:12:09 +0000 (17:12 -0400)
Clearing the points is now initializing the list to NULL. This causes the list
to be reusable. Otherwise points can't be added to it afterwards.

champlain/champlain-polygon.c

index 1bdcd6d79d045edc58f3f78e1de26211ec187f61..8567c20db2aea584bd1b395fa098ac2b51b2e6fc 100644 (file)
@@ -391,6 +391,7 @@ champlain_polygon_clear_points (ChamplainPolygon *self)
     next = g_list_next (next);
   }
   g_list_free (self->priv->points);
+  self->priv->points = NULL;
   g_object_notify (G_OBJECT (self), "visible");
 }