summaryrefslogtreecommitdiff
path: root/gtk/gtkpathbar.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@imendio.com>2006-09-04 19:32:13 +0000
committerKristian Rietveld <kristian@src.gnome.org>2006-09-04 19:32:13 +0000
commit118715cb43d6f1a1d51c9feeef81bb60adfab91b (patch)
treef132deb003ea999b3c95212093d8617061b33b64 /gtk/gtkpathbar.c
parentda07fc7a6e1a2d5d5de27e1bf236d15b734a817e (diff)
downloadgdk-pixbuf-118715cb43d6f1a1d51c9feeef81bb60adfab91b.tar.gz
don't cancel the operations spawned by buttons here,
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).
Diffstat (limited to 'gtk/gtkpathbar.c')
-rw-r--r--gtk/gtkpathbar.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 155f740a3..5cd240cee 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -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 *