summaryrefslogtreecommitdiff
path: root/gnode.c
diff options
context:
space:
mode:
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>2000-04-17 13:23:27 +0000
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>2000-04-17 13:23:27 +0000
commit8c90d7766b1708a8bcb3cb96988b6b7fc92c2e59 (patch)
tree9bf74b09c3cd4b70ab5216e8085c41d3dec24f8f /gnode.c
parent03f9d485c1435c342c936a26626dda440c1911b9 (diff)
downloadglib-8c90d7766b1708a8bcb3cb96988b6b7fc92c2e59.tar.gz
Add configure test for garbage collector friendliness for GLib. If
2000-04-17 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * configure.in, acconfig.h: Add configure test for garbage collector friendliness for GLib. If enabled, ENABLE_GC_FRIENDLY will be defined. * garray.c, ghash.c, glist.c, gmain.c, gmem.c, gnode.c, gqueue.c, gslist.c, gtree.c: If ENABLE_GC_FRIENDLY is defined, NULLify all memory released by the user, but cached by GLib. This lets a garbage collector have a more correct view of the actually used memory.
Diffstat (limited to 'gnode.c')
-rw-r--r--gnode.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gnode.c b/gnode.c
index 5db03c639..a21b78e4d 100644
--- a/gnode.c
+++ b/gnode.c
@@ -82,7 +82,7 @@ void
g_node_push_allocator (GAllocator *allocator)
{
G_LOCK (current_allocator);
- g_node_validate_allocator ( allocator );
+ g_node_validate_allocator (allocator);
allocator->last = current_allocator;
current_allocator = allocator;
G_UNLOCK (current_allocator);
@@ -148,6 +148,14 @@ g_nodes_free (GNode *node)
{
if (parent->children)
g_nodes_free (parent->children);
+
+#ifdef ENABLE_GC_FRIENDLY
+ parent->data = NULL;
+ parent->prev = NULL;
+ parent->parent = NULL;
+ parent->children = NULL;
+#endif /* ENABLE_GC_FRIENDLY */
+
if (parent->next)
parent = parent->next;
else