]> Pileus Git - ~andy/gtk/commitdiff
don't cancel the operations spawned by buttons here,
authorKristian Rietveld <kris@imendio.com>
Mon, 4 Sep 2006 19:32:13 +0000 (19:32 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Mon, 4 Sep 2006 19:32:13 +0000 (19:32 +0000)
2006-09-04  Kristian Rietveld  <kris@imendio.com>

* gtk/gtkpathbar.c (gtk_path_bar_dispose): don't cancel the
operations spawned by buttons here,
(set_button_image_get_info_cb): bail out if button is NULL, but
do free button_data,
(button_data_free): only free the data is non NULL (since this
function can be called multiple times for the same data), cancel
handle is pending but don't free button_data in this case (will
happen in the callback).

ChangeLog
gtk/gtkpathbar.c

index 33e1f6dc46b9b12d0262566375badca4ee6e68d2..a2ba206e0d3837e5bbce516f7b57a1a5f0c909f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-09-04  Kristian Rietveld  <kris@imendio.com>
+
+       * gtk/gtkpathbar.c (gtk_path_bar_dispose): don't cancel the
+       operations spawned by buttons here,
+       (set_button_image_get_info_cb): bail out if button is NULL, but
+       do free button_data,
+       (button_data_free): only free the data is non NULL (since this
+       function can be called multiple times for the same data), cancel
+       handle is pending but don't free button_data in this case (will
+       happen in the callback).
+
 2006-09-04  Michael Natterer  <mitch@imendio.com>
 
        * gtk/gtkrc.c (rc_parse_token_or_compound)
index 155f740a3e449e1d491e618fcb9ed1b39fd7cd00..5cd240cee6303103c60da01711796b5f578510a9 100644 (file)
@@ -259,15 +259,6 @@ gtk_path_bar_dispose (GObject *object)
     gtk_file_system_cancel_operation (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;
-    }
-
   G_OBJECT_CLASS (gtk_path_bar_parent_class)->dispose (object);
 }
 
@@ -1020,6 +1011,12 @@ set_button_image_get_info_cb (GtkFileSystemHandle *handle,
 
   data->button_data->handle = NULL;
 
+  if (!data->button_data->button)
+    {
+      g_free (data->button_data);
+      goto out;
+    }
+
   if (cancelled || error)
     goto out;
 
@@ -1134,12 +1131,20 @@ set_button_image (GtkPathBar *path_bar,
 static void
 button_data_free (ButtonData *button_data)
 {
+  if (button_data->path)
+    gtk_file_path_free (button_data->path);
+  button_data->path = NULL;
+
+  if (button_data->dir_name)
+    g_free (button_data->dir_name);
+  button_data->dir_name = NULL;
+
+  button_data->button = NULL;
+
   if (button_data->handle)
     gtk_file_system_cancel_operation (button_data->handle);
-
-  gtk_file_path_free (button_data->path);
-  g_free (button_data->dir_name);
-  g_free (button_data);
+  else
+    g_free (button_data);
 }
 
 static const char *