[libchamplain] Fix a memory bug in champlain_polygon_clear_points()



commit c7d2e9aefd6b119655ddc25848283a149cd48b3c
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Wed Jul 29 22:26:05 2009 +0200

    Fix a memory bug in champlain_polygon_clear_points()
    
    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 |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlain-polygon.c b/champlain/champlain-polygon.c
index 1bdcd6d..8567c20 100644
--- a/champlain/champlain-polygon.c
+++ b/champlain/champlain-polygon.c
@@ -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");
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]