aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2010-10-10 22:38:40 +0800
committerXan Lopez <xan@gnome.org>2010-10-12 20:15:44 +0800
commitcc56e3e286232da24a6508650b7ef026a494535b (patch)
treec5b15061d27580ac9aa6b73a40d799f7cbe45273 /lib
parent76c730a46e58a239a448c68115d1e44ca9199749 (diff)
downloadgsoc2013-epiphany-cc56e3e286232da24a6508650b7ef026a494535b.tar
gsoc2013-epiphany-cc56e3e286232da24a6508650b7ef026a494535b.tar.gz
gsoc2013-epiphany-cc56e3e286232da24a6508650b7ef026a494535b.tar.bz2
gsoc2013-epiphany-cc56e3e286232da24a6508650b7ef026a494535b.tar.lz
gsoc2013-epiphany-cc56e3e286232da24a6508650b7ef026a494535b.tar.xz
gsoc2013-epiphany-cc56e3e286232da24a6508650b7ef026a494535b.tar.zst
gsoc2013-epiphany-cc56e3e286232da24a6508650b7ef026a494535b.zip
ephy-node-db: make the db unref all remaining nodes on destruction
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-node-db.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ephy-node-db.c b/lib/ephy-node-db.c
index 2a9563198..1a80e779f 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;