diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | gtk/gtkpathbar.c | 31 |
2 files changed, 29 insertions, 13 deletions
@@ -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) 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 * |