[gtk+/wip/csoriano/gtkpathbar_rework: 116/120] gtkpathbar: only unref cancelable when it exists



commit db21becd13bda01f16b19aaa807ddc879d54f67c
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Mar 4 19:12:54 2015 +0100

    gtkpathbar: only unref cancelable when it exists

 gtk/gtkpathbar.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 79a4f52..2eddd1b 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1754,9 +1754,11 @@ _gtk_path_bar_set_file (GtkPathBar *path_bar,
   info->parent_file = g_file_get_parent (info->file);
 
   if (path_bar->priv->get_info_cancellable)
-    g_cancellable_cancel (path_bar->priv->get_info_cancellable);
+    {
+      g_cancellable_cancel (path_bar->priv->get_info_cancellable);
+      g_object_unref (path_bar->priv->get_info_cancellable);
+    }
 
-  g_object_unref (path_bar->priv->get_info_cancellable);
   path_bar->priv->get_info_cancellable = g_cancellable_new ();
 
   g_file_query_info_async (file,


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