[anjuta/gnome-2-26] git: Don't reference child revisions (bgo 584347)



commit 6677552c1cba19d984a90b95dde1166c98f17887
Author: James Liggett <jrliggett cox net>
Date:   Sun Jun 7 00:23:55 2009 -0700

    git: Don't reference child revisions (bgo 584347)
    
    On some machines, the references that revisions hold to their children can be the last references
    held on thoses revisions, resulting in a long chain of recursive finalizations that can crash because of
    a double free on some revisions.
---
 plugins/git/git-revision.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/plugins/git/git-revision.c b/plugins/git/git-revision.c
index c6efb27..7eece16 100644
--- a/plugins/git/git-revision.c
+++ b/plugins/git/git-revision.c
@@ -46,7 +46,6 @@ static void
 git_revision_finalize (GObject *object)
 {
 	GitRevision *self;
-	GList *current_child;
 	
 	self = GIT_REVISION (object);
 	
@@ -55,14 +54,6 @@ git_revision_finalize (GObject *object)
 	g_free (self->priv->date);
 	g_free (self->priv->short_log);
 	
-	current_child = self->priv->children;
-	
-	while (current_child)
-	{
-		g_object_unref (current_child->data);
-		current_child = g_list_next (current_child);
-	}
-	
 	g_list_free (self->priv->children);
 	g_free (self->priv);
 
@@ -214,7 +205,7 @@ void
 git_revision_add_child (GitRevision *self, GitRevision *child)
 {
 	self->priv->children = g_list_prepend (self->priv->children,
-										  g_object_ref (child));
+										  child);
 	git_revision_set_has_parents (child, TRUE);
 }
 



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