aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-folder-view.c10
2 files changed, 18 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 45d3b38948..5d9709bef8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2004-02-20 Jeffrey Stedfast <fejj@ximian.com>
+
+ Fix for bug #53997
+
+ * em-folder-view.c (emfv_list_message_selected): Ref the emfv
+ before spawning the async event.
+ (emfv_list_done_message_selected): Check emfv->preview !=
+ NULL. Also unref the emfv when done.
+
2004-02-20 Dan Winship <danw@ximian.com>
* mail-component.c (set_prop): Remove the debug message here.
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index bec6164409..fe37964206 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -1742,7 +1742,12 @@ static void
emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data)
{
EMFolderView *emfv = data;
-
+
+ if (emfv->preview == NULL) {
+ g_object_unref (emfv);
+ return;
+ }
+
em_format_format((EMFormat *)emfv->preview, folder, uid, msg);
if (emfv->priv->seen_id)
@@ -1762,6 +1767,8 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
camel_folder_set_message_flags(emfv->folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
}
}
+
+ g_object_unref (emfv);
}
static void
@@ -1774,6 +1781,7 @@ emfv_list_message_selected(MessageList *ml, const char *uid, EMFolderView *emfv)
if (emfv->displayed_uid == NULL || strcmp(emfv->displayed_uid, uid) != 0) {
g_free(emfv->displayed_uid);
emfv->displayed_uid = g_strdup(uid);
+ g_object_ref (emfv);
mail_get_message(emfv->folder, uid, emfv_list_done_message_selected, emfv, mail_thread_new);
}
} else {