From 37da199d52b64066f069d530699b103e29bf8a2b Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Mon, 4 Sep 2006 20:57:45 +0000 Subject: [PATCH] Merged from HEAD: 2006-09-04 Kristian Rietveld Merged from HEAD: * 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 if non NULL (since this function can be called multiple times for the same data), cancel handle if pending but don't free button_data in this case (will happen in the callback). --- ChangeLog | 13 +++++++++++++ gtk/gtkpathbar.c | 31 ++++++++++++++++++------------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97daf8201e..4dbdfcf552 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2006-09-04 Kristian Rietveld + + Merged from HEAD: + + * 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 if non NULL (since this + function can be called multiple times for the same data), cancel + handle if pending but don't free button_data in this case (will + happen in the callback). + 2006-09-04 Kristian Rietveld Merged from HEAD: diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index 155f740a3e..5cd240cee6 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 *