From 529b6c87c3341d6249a65cd092d0244c704f6aa0 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Mon, 28 Oct 2002 09:16:05 +0000 Subject: don't queue the action until we've added ourselves to the active list, 2002-10-27 Larry Ewing * mail-display.c (fetch_next): don't queue the action until we've added ourselves to the active list, because the fetch_done callback can fire immediately and we'll end up queueing something that has already been destroyed. svn path=/trunk/; revision=18452 --- mail/ChangeLog | 7 +++++++ mail/mail-display.c | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 30f5853f50..36bd3749c8 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2002-10-27 Larry Ewing + + * mail-display.c (fetch_next): don't queue the action until we've + added ourselves to the active list, because the fetch_done + callback can fire immediately and we'll end up queueing something + that has already been destroyed. + 2002-10-24 Jeffrey Stedfast Update the upgrade script to handle the new url format introduced diff --git a/mail/mail-display.c b/mail/mail-display.c index df71ddb368..c088323f56 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1327,13 +1327,15 @@ static void fetch_next(MailDisplay *md) && (rd = (struct _remote_data *)e_dlist_remhead(&p->fetch_queue))) { ctx = soup_context_get(rd->uri); - rd->msg = msg = soup_message_new(ctx, SOUP_METHOD_GET); - soup_context_unref(ctx); + rd->msg = msg = soup_message_new(ctx, SOUP_METHOD_GET); + + if (ctx) + soup_context_unref(ctx); + soup_message_set_flags(msg, SOUP_MESSAGE_OVERWRITE_CHUNKS); soup_message_add_handler(msg, SOUP_HANDLER_BODY_CHUNK, fetch_data, rd); - soup_message_queue(msg, fetch_done, rd); - e_dlist_addtail(&p->fetch_active, (EDListNode *)rd); + soup_message_queue(msg, fetch_done, rd); } } -- cgit