diff options
author | Not Zed <NotZed@Ximian.com> | 2002-12-03 12:24:47 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-12-03 12:24:47 +0800 |
commit | 58b68db327f2f02c251ef5b9c41f7623a3bf417f (patch) | |
tree | 5d1867c5731352331cce8b871febad3c0a0a1600 | |
parent | d16c201e161dee6c1919ffd2cd6eafe060825fd1 (diff) | |
download | gsoc2013-evolution-58b68db327f2f02c251ef5b9c41f7623a3bf417f.tar.gz gsoc2013-evolution-58b68db327f2f02c251ef5b9c41f7623a3bf417f.tar.zst gsoc2013-evolution-58b68db327f2f02c251ef5b9c41f7623a3bf417f.zip |
frobbed around with these till it exits without crashing.
2002-12-03 Not Zed <NotZed@Ximian.com>
* folder-browser.c (folder_browser_finalise/destroy): frobbed
around with these till it exits without crashing.
* message-list.c (message_list_destroy): made a destroy
handler again (was dispose). Frobbed around with this and
finalise till it can destroy without crashing.
* message-browser.c (message_browser_new): ref/sink the
folderbrowser.
svn path=/trunk/; revision=18991
-rw-r--r-- | mail/ChangeLog | 12 | ||||
-rw-r--r-- | mail/folder-browser.c | 92 | ||||
-rw-r--r-- | mail/message-browser.c | 3 | ||||
-rw-r--r-- | mail/message-list.c | 65 |
4 files changed, 104 insertions, 68 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 07b87bb155..dbb82a84f6 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,15 @@ +2002-12-03 Not Zed <NotZed@Ximian.com> + + * folder-browser.c (folder_browser_finalise/destroy): frobbed + around with these till it exits without crashing. + + * message-list.c (message_list_destroy): made a destroy + handler again (was dispose). Frobbed around with this and + finalise till it can destroy without crashing. + + * message-browser.c (message_browser_new): ref/sink the + folderbrowser. + 2002-11-25 Radek Doulik <rodo@ximian.com> * mail-preferences.c (mail_preferences_construct): magic_check --> diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 093ede8288..7bb1ca2ccc 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -130,54 +130,17 @@ static void folder_browser_finalise (GObject *object) { FolderBrowser *folder_browser; - CORBA_Environment ev; folder_browser = FOLDER_BROWSER (object); - - CORBA_exception_init (&ev); - + g_free (folder_browser->loading_uid); g_free (folder_browser->pending_uid); g_free (folder_browser->new_uid); g_free (folder_browser->loaded_uid); - if (folder_browser->search_full) - g_object_unref (folder_browser->search_full); - - if (folder_browser->sensitize_timeout_id) - g_source_remove (folder_browser->sensitize_timeout_id); - - if (folder_browser->shell != CORBA_OBJECT_NIL) { - CORBA_Object_release (folder_browser->shell, &ev); - folder_browser->shell = CORBA_OBJECT_NIL; - } - - if (folder_browser->shell_view != CORBA_OBJECT_NIL) { - CORBA_Object_release (folder_browser->shell_view, &ev); - folder_browser->shell_view = CORBA_OBJECT_NIL; - } - - if (folder_browser->uicomp) - bonobo_object_unref (BONOBO_OBJECT (folder_browser->uicomp)); - g_free (folder_browser->uri); folder_browser->uri = NULL; - - CORBA_exception_free (&ev); - - if (folder_browser->view_instance) { - g_object_unref (folder_browser->view_instance); - folder_browser->view_instance = NULL; - } - - if (folder_browser->view_menus) { - g_object_unref (folder_browser->view_menus); - folder_browser->view_menus = NULL; - } - - g_object_unref (folder_browser->invisible); - folder_browser->invisible = NULL; - + if (folder_browser->clipboard_selection) g_byte_array_free (folder_browser->clipboard_selection, TRUE); @@ -193,9 +156,12 @@ static void folder_browser_destroy (GtkObject *object) { FolderBrowser *folder_browser; + CORBA_Environment ev; folder_browser = FOLDER_BROWSER (object); - + + CORBA_exception_init (&ev); + if (folder_browser->seen_id != 0) { gtk_timeout_remove (folder_browser->seen_id); folder_browser->seen_id = 0; @@ -215,10 +181,50 @@ folder_browser_destroy (GtkObject *object) gtk_widget_destroy (GTK_WIDGET (folder_browser->mail_display)); folder_browser->mail_display = NULL; } + + if (folder_browser->view_instance) { + g_object_unref (folder_browser->view_instance); + folder_browser->view_instance = NULL; + } + + if (folder_browser->view_menus) { + g_object_unref (folder_browser->view_menus); + folder_browser->view_menus = NULL; + } /* wait for all outstanding async events against us */ mail_async_event_destroy (folder_browser->async_event); + + if (folder_browser->search_full) { + g_object_unref (folder_browser->search_full); + folder_browser->search_full = NULL; + } + + if (folder_browser->sensitize_timeout_id) { + g_source_remove (folder_browser->sensitize_timeout_id); + folder_browser->sensitize_timeout_id = 0; + } + if (folder_browser->shell != CORBA_OBJECT_NIL) { + CORBA_Object_release (folder_browser->shell, &ev); + folder_browser->shell = CORBA_OBJECT_NIL; + } + + if (folder_browser->shell_view != CORBA_OBJECT_NIL) { + CORBA_Object_release (folder_browser->shell_view, &ev); + folder_browser->shell_view = CORBA_OBJECT_NIL; + } + + if (folder_browser->uicomp) { + bonobo_object_unref (BONOBO_OBJECT (folder_browser->uicomp)); + folder_browser->uicomp = NULL; + } + + if (folder_browser->invisible) { + g_object_unref (folder_browser->invisible); + folder_browser->invisible = NULL; + } + if (folder_browser->get_id != -1) { mail_msg_cancel (folder_browser->get_id); folder_browser->get_id = -1; @@ -233,6 +239,8 @@ folder_browser_destroy (GtkObject *object) camel_object_unref (folder_browser->folder); folder_browser->folder = NULL; } + + CORBA_exception_free (&ev); GTK_OBJECT_CLASS (parent_class)->destroy (object); } @@ -2545,7 +2553,9 @@ my_folder_browser_init (FolderBrowser *fb) /* cut, copy & paste */ fb->invisible = gtk_invisible_new (); - + g_object_ref(fb->invisible); + gtk_object_sink(fb->invisible); + for (i = 0; i < num_paste_types; i++) gtk_selection_add_target (fb->invisible, clipboard_atom, paste_types[i].target, diff --git a/mail/message-browser.c b/mail/message-browser.c index 7ecdbdd997..8306d7ee1d 100644 --- a/mail/message-browser.c +++ b/mail/message-browser.c @@ -318,6 +318,9 @@ message_browser_new (const GNOME_Evolution_Shell shell, const char *uri, const c g_object_set_data_full(G_OBJECT(new), "uid", g_strdup (uid), g_free); fb = FOLDER_BROWSER (folder_browser_new (shell, uri)); + g_object_ref(fb); + gtk_object_sink((GtkObject *)fb); + new->fb = fb; set_bonobo_ui (GTK_WIDGET (new), fb); diff --git a/mail/message-list.c b/mail/message-list.c index f6de16b362..e9f8856000 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1260,48 +1260,64 @@ normalised_free (gpointer key, gpointer value, gpointer user_data) } static void -message_list_dispose(GObject *object) +message_list_destroy(GtkObject *object) { MessageList *message_list = MESSAGE_LIST (object); + if (message_list->async_event) { + mail_async_event_destroy(message_list->async_event); + message_list->async_event = NULL; + } + if (message_list->folder) { + /* need to do this before removing folder, folderinfo's might not exist after */ + if (message_list->uid_nodemap) { + g_hash_table_foreach(message_list->uid_nodemap, (GHFunc)clear_info, message_list); + g_hash_table_destroy (message_list->uid_nodemap); + } + save_tree_state(message_list); hide_save_state(message_list); + camel_object_unhook_event(message_list->folder, "folder_changed", folder_changed, message_list); + camel_object_unhook_event(message_list->folder, "message_changed", message_changed, message_list); + camel_object_unref (message_list->folder); + message_list->folder = NULL; + } + + if (message_list->extras) { + g_object_unref((message_list->extras)); + message_list->extras = NULL; } - G_OBJECT_CLASS (message_list_parent_class)->dispose(object); + if (message_list->model) { + g_object_unref((message_list->model)); + message_list->model = NULL; + } + + if (message_list->idle_id != 0) { + g_source_remove (message_list->idle_id); + message_list->idle_id = 0; + } + + if (message_list->seen_id) { + g_source_remove (message_list->seen_id); + message_list->seen_id = 0; + } + + GTK_OBJECT_CLASS (message_list_parent_class)->destroy(object); } static void message_list_finalise (GObject *object) { MessageList *message_list = MESSAGE_LIST (object); - - mail_async_event_destroy(message_list->async_event); g_hash_table_foreach (message_list->normalised_hash, normalised_free, NULL); g_hash_table_destroy (message_list->normalised_hash); - if (message_list->folder) { - camel_object_unhook_event(message_list->folder, "folder_changed", folder_changed, message_list); - camel_object_unhook_event(message_list->folder, "message_changed", message_changed, message_list); - camel_object_unref (message_list->folder); - } - if (message_list->thread_tree) camel_folder_thread_messages_unref(message_list->thread_tree); - if (message_list->extras) - g_object_unref((message_list->extras)); - if (message_list->model) - g_object_unref((message_list->model)); - - if (message_list->idle_id != 0) - g_source_remove (message_list->idle_id); - - if (message_list->seen_id) - g_source_remove (message_list->seen_id); - if (message_list->hidden) { g_hash_table_destroy(message_list->hidden); e_mempool_destroy(message_list->hidden_pool); @@ -1309,11 +1325,6 @@ message_list_finalise (GObject *object) message_list->hidden_pool = NULL; } - if (message_list->uid_nodemap) { - g_hash_table_foreach(message_list->uid_nodemap, (GHFunc)clear_info, message_list); - g_hash_table_destroy (message_list->uid_nodemap); - } - g_free(message_list->cursor_uid); g_mutex_free(message_list->hide_lock); @@ -1330,7 +1341,7 @@ message_list_class_init (GObjectClass *object_class) message_list_parent_class = g_type_class_ref(PARENT_TYPE); object_class->finalize = message_list_finalise; - object_class->dispose = message_list_dispose; + ((GtkObjectClass *)object_class)->destroy = message_list_destroy; message_list_signals[MESSAGE_SELECTED] = g_signal_new ("message_selected", |