[anjuta] git: properly unset the log command in the case the command failed



commit 981f47ed3fed0ea5e6d96e5497343bd08ae35838
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Thu Feb 21 23:01:18 2013 +0100

    git: properly unset the log command in the case the command failed
    
    Previously we just unreffed the command without setting our pointer
    to NULL.

 plugins/git/git-log-pane.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/plugins/git/git-log-pane.c b/plugins/git/git-log-pane.c
index 14a04ed..e9f5531 100644
--- a/plugins/git/git-log-pane.c
+++ b/plugins/git/git-log-pane.c
@@ -296,9 +296,7 @@ on_log_command_finished (AnjutaCommand *command, guint return_code,
                git_pane_report_errors (command, return_code,
                                        ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE 
(self))));
 #endif
-               g_object_unref (command);
-               
-               return;
+               goto out;
        }
        
        queue = git_log_command_get_output_queue (GIT_LOG_COMMAND (command));
@@ -319,7 +317,8 @@ on_log_command_finished (AnjutaCommand *command, guint return_code,
                                                                                  0);
        gtk_tree_view_set_model (GTK_TREE_VIEW (log_view), 
                                                         GTK_TREE_MODEL (self->priv->log_model));
-       
+
+out:
        g_clear_object (&self->priv->log_command);
 }
 


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