From f36b98c762713940dc60848cfa138d769f1f6eab Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 18 Apr 2013 16:55:38 -0400 Subject: Bug 698042 - Crash when sending e-mail with attachment (cherry picked from commit d4473cf20a4991400f1ccbaecab8f8a82198a9a8) --- e-util/e-attachment-store.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'e-util') diff --git a/e-util/e-attachment-store.c b/e-util/e-attachment-store.c index f434f5e81c..16f38fb5e5 100644 --- a/e-util/e-attachment-store.c +++ b/e-util/e-attachment-store.c @@ -281,6 +281,13 @@ e_attachment_store_remove_all (EAttachmentStore *store) if (!g_hash_table_size (store->priv->attachment_index)) return; + /* Clear the list store before cancelling EAttachment load/save + * operations. This will invalidate the EAttachment's tree row + * reference so it won't try to update the row's icon column in + * response to the cancellation. That can create problems when + * the list store is being disposed. */ + gtk_list_store_clear (GTK_LIST_STORE (store)); + g_object_freeze_notify (G_OBJECT (store)); list = e_attachment_store_get_attachments (store); @@ -294,8 +301,6 @@ e_attachment_store_remove_all (EAttachmentStore *store) g_list_foreach (list, (GFunc) g_object_unref, NULL); g_list_free (list); - gtk_list_store_clear (GTK_LIST_STORE (store)); - g_object_notify (G_OBJECT (store), "num-attachments"); g_object_notify (G_OBJECT (store), "total-size"); g_object_thaw_notify (G_OBJECT (store)); -- cgit v1.2.3