[anjuta] git: Fix assertion when running g_hash_table_unref() on a NULL pointer.



commit db14699e87809d35eb728f49d2aa53db4dffe9d1
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Sun Nov 18 21:03:19 2012 +0100

    git: Fix assertion when running g_hash_table_unref() on a NULL pointer.
    
    self->priv->refs will not be set until the command has finished so it may be NULL when the
    plugin is deactivated.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688602

 plugins/git/git-log-pane.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/git/git-log-pane.c b/plugins/git/git-log-pane.c
index 3a79c15..98e0b05 100644
--- a/plugins/git/git-log-pane.c
+++ b/plugins/git/git-log-pane.c
@@ -992,7 +992,10 @@ git_log_pane_finalize (GObject *object)
 	g_object_unref (self->priv->builder);
 	g_free (self->priv->path);
 	g_hash_table_destroy (self->priv->branches_table);
-	g_hash_table_unref (self->priv->refs);
+
+	if (self->priv->refs)
+		g_hash_table_unref (self->priv->refs);
+
 	g_free (self->priv->selected_branch);
 
 	if (self->priv->active_branch_path != NULL)



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