Index: gtk/gtkpathbar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkpathbar.c,v
retrieving revision 1.56
diff -u -p -r1.56 gtkpathbar.c
--- gtk/gtkpathbar.c	6 Jul 2006 05:14:01 -0000	1.56
+++ gtk/gtkpathbar.c	4 Aug 2006 23:11:48 -0000
@@ -256,16 +256,22 @@ gtk_path_bar_dispose (GObject *object)
   remove_settings_signal (path_bar, gtk_widget_get_screen (GTK_WIDGET (object)));
 
   if (path_bar->set_path_handle)
-    gtk_file_system_cancel_operation (path_bar->set_path_handle);
-  path_bar->set_path_handle = NULL;
+    {
+      gtk_file_system_cancel_operation (path_bar->set_path_handle);
+      g_object_unref (path_bar->set_path_handle);
+      path_bar->set_path_handle = NULL;
+    }
 
   for (list = path_bar->button_list; list; list = list->next)
     {
       ButtonData *button_data = BUTTON_DATA (list->data);
 
       if (button_data->handle)
-	gtk_file_system_cancel_operation (button_data->handle);
-      button_data->handle = NULL;
+	{
+	  gtk_file_system_cancel_operation (button_data->handle);
+	  g_object_unref (button_data->handle);
+	  button_data->handle = NULL;
+	}
     }
 
   G_OBJECT_CLASS (gtk_path_bar_parent_class)->dispose (object);
@@ -1015,12 +1021,16 @@ set_button_image_get_info_cb (GtkFileSys
   GdkPixbuf *pixbuf;
   struct SetButtonImageData *data = user_data;
 
+  if (cancelled)
+    goto out;
+
   if (handle != data->button_data->handle)
     goto out;
 
+  g_object_unref (data->button_data->handle);
   data->button_data->handle = NULL;
 
-  if (cancelled || error)
+  if (error)
     goto out;
 
   pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (data->path_bar),
@@ -1049,7 +1059,6 @@ set_button_image_get_info_cb (GtkFileSys
 
 out:
   g_free (data);
-  g_object_unref (handle);
 }
 
 static void
@@ -1095,7 +1104,10 @@ set_button_image (GtkPathBar *path_bar,
       data->button_data = button_data;
 
       if (button_data->handle)
-	gtk_file_system_cancel_operation (button_data->handle);
+	{
+	  gtk_file_system_cancel_operation (button_data->handle);
+	  g_object_unref (button_data->handle);
+	}
 
       button_data->handle =
         gtk_file_system_get_info (path_bar->file_system,
@@ -1117,7 +1129,10 @@ set_button_image (GtkPathBar *path_bar,
       data->button_data = button_data;
 
       if (button_data->handle)
-	gtk_file_system_cancel_operation (button_data->handle);
+	{
+	  gtk_file_system_cancel_operation (button_data->handle);
+	  g_object_unref (button_data->handle);
+	}
 
       button_data->handle =
         gtk_file_system_get_info (path_bar->file_system,
@@ -1135,7 +1150,10 @@ static void
 button_data_free (ButtonData *button_data)
 {
   if (button_data->handle)
-    gtk_file_system_cancel_operation (button_data->handle);
+    {
+      gtk_file_system_cancel_operation (button_data->handle);
+      g_object_unref (button_data->handle);
+    }
 
   gtk_file_path_free (button_data->path);
   g_free (button_data->dir_name);
@@ -1461,17 +1479,16 @@ gtk_path_bar_get_info_callback (GtkFileS
   gboolean is_hidden;
   gboolean valid;
 
-  if (handle != path_info->path_bar->set_path_handle)
+  if (cancelled || handle != path_info->path_bar->set_path_handle)
     {
       gtk_path_bar_set_path_finish (path_info, FALSE);
-      g_object_unref (handle);
       return;
     }
 
-  g_object_unref (handle);
   path_info->path_bar->set_path_handle = NULL;
+  g_object_unref (handle);
 
-  if (cancelled || !file_info)
+  if (!file_info)
     {
       gtk_path_bar_set_path_finish (path_info, FALSE);
       return;
@@ -1555,7 +1572,10 @@ _gtk_path_bar_set_path (GtkPathBar      
     }
 
   if (path_bar->set_path_handle)
-    gtk_file_system_cancel_operation (path_bar->set_path_handle);
+    {
+      gtk_file_system_cancel_operation (path_bar->set_path_handle);
+      g_object_unref (path_bar->set_path_handle);
+    }
 
   path_bar->set_path_handle =
     gtk_file_system_get_info (path_bar->file_system,
