[epiphany] ephy-node-db: make the db unref all remaining nodes on destruction



commit cc56e3e286232da24a6508650b7ef026a494535b
Author: Xan Lopez <xan gnome org>
Date:   Sun Oct 10 23:38:40 2010 +0900

    ephy-node-db: make the db unref all remaining nodes on destruction

 lib/ephy-node-db.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/lib/ephy-node-db.c b/lib/ephy-node-db.c
index 2a95631..1a80e77 100644
--- a/lib/ephy-node-db.c
+++ b/lib/ephy-node-db.c
@@ -94,12 +94,19 @@ ephy_node_db_set_property (GObject *object,
 }
 
 static void
+ephy_node_db_free_func (EphyNode *node)
+{
+    if (node)
+	    ephy_node_unref (node);
+}
+
+static void
 ephy_node_db_init (EphyNodeDb *db)
 {
 	db->priv = EPHY_NODE_DB_GET_PRIVATE (db);
 
 	/* id to node */
-	db->priv->id_to_node = g_ptr_array_new ();
+	db->priv->id_to_node = g_ptr_array_new_with_free_func ((GDestroyNotify)ephy_node_db_free_func);
 
 	/* id factory */
 	db->priv->id_factory = RESERVED_IDS;



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