From 246388d822fec83b0ce78e460b9d2f5793f6d2f1 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 30 Apr 2001 13:55:29 +0000 Subject: Unhook event handlers before syncing the folder, since the folder browser * folder-browser.c (folder_browser_destroy): Unhook event handlers before syncing the folder, since the folder browser will have been destroyed by the time the sync thread completes and calls the signal handlers. svn path=/trunk/; revision=9630 --- mail/ChangeLog | 7 +++++++ mail/folder-browser.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 593afac972..73f6b34ca7 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2001-04-30 Dan Winship + + * folder-browser.c (folder_browser_destroy): Unhook event handlers + before syncing the folder, since the folder browser will have been + destroyed by the time the sync thread completes and calls the + signal handlers. + 2001-04-29 Dan Winship * mail-format.c (handle_text_plain_flowed): Mojo this a bit so diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 6bbb672ea5..a1fb0b98ec 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -49,6 +49,7 @@ #define PARENT_TYPE (gtk_table_get_type ()) static void fb_resize_cb (GtkWidget *w, GtkAllocation *a); +static void update_unread_count (CamelObject *, gpointer, gpointer); static GtkObjectClass *folder_browser_parent_class; @@ -79,8 +80,14 @@ folder_browser_destroy (GtkObject *object) g_free (folder_browser->uri); if (folder_browser->folder) { + CamelObject *folder = CAMEL_OBJECT (folder_browser->folder); + + camel_object_unhook_event (folder, "message_changed", + update_unread_count, folder_browser); + camel_object_unhook_event (folder, "folder_changed", + update_unread_count, folder_browser); mail_sync_folder (folder_browser->folder, NULL, NULL); - camel_object_unref (CAMEL_OBJECT (folder_browser->folder)); + camel_object_unref (folder); } if (folder_browser->message_list) -- cgit v1.2.3