[libchamplain] view: Set world_bbox to NULL in dispose



commit cf42830731b5f7b58733b0057cb0ffd02700ea73
Author: Jiří Techet <techet gmail com>
Date:   Mon Aug 31 01:26:23 2015 +0200

    view: Set world_bbox to NULL in dispose
    
    Prevents double-free as dispose can be called multiple times.

 champlain/champlain-view.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 36da9c0..48df08c 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -699,7 +699,10 @@ champlain_view_dispose (GObject *object)
   priv->zoom_layer = NULL;
 
   if (priv->world_bbox)
-    champlain_bounding_box_free (priv->world_bbox);
+    {
+      champlain_bounding_box_free (priv->world_bbox);
+      priv->world_bbox = NULL;
+    }
 
   G_OBJECT_CLASS (champlain_view_parent_class)->dispose (object);
 }


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