From 9955814a761a6365a57b66284f6c5682192f17cd Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 24 Jun 2008 08:01:04 +0000 Subject: ** Fix for bug #537275 2008-06-24 Milan Crha ** Fix for bug #537275 * em-html-stream.c: (emhs_cleanup): Close GtkHTMLStream on cancel. * em-html-stream.c: (emhs_gtkhtml_destroy): Set the cancel. * em-sync-stream.c: (emss_process_message): Do not pass data to the child structure if we were canceled. svn path=/trunk/; revision=35680 --- mail/ChangeLog | 9 +++++++++ mail/em-html-stream.c | 3 +++ mail/em-sync-stream.c | 7 +++++++ 3 files changed, 19 insertions(+) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 5622614a23..750355286a 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2008-06-24 Milan Crha + + ** Fix for bug #537275 + + * em-html-stream.c: (emhs_cleanup): Close GtkHTMLStream on cancel. + * em-html-stream.c: (emhs_gtkhtml_destroy): Set the cancel. + * em-sync-stream.c: (emss_process_message): + Do not pass data to the child structure if we were canceled. + 2008-06-21 Paul Bolle ** Fix for bug #539268 diff --git a/mail/em-html-stream.c b/mail/em-html-stream.c index 656f736969..2644afcf3d 100644 --- a/mail/em-html-stream.c +++ b/mail/em-html-stream.c @@ -80,6 +80,8 @@ em_html_stream_init (CamelObject *object) static void emhs_cleanup(EMHTMLStream *emhs) { + if (emhs->sync.cancel && emhs->html_stream) + gtk_html_stream_close (emhs->html_stream, GTK_HTML_STREAM_ERROR); emhs->html_stream = NULL; emhs->sync.cancel = TRUE; g_signal_handler_disconnect(emhs->html, emhs->destroy_id); @@ -147,6 +149,7 @@ static void emhs_gtkhtml_destroy(struct _GtkHTML *html, EMHTMLStream *emhs) { d(printf("%p: emhs gtkhtml destroy\n", emhs)); + emhs->sync.cancel = TRUE; emhs_cleanup(emhs); } diff --git a/mail/em-sync-stream.c b/mail/em-sync-stream.c index e8aad7f31c..82c8b20aeb 100644 --- a/mail/em-sync-stream.c +++ b/mail/em-sync-stream.c @@ -59,6 +59,13 @@ emss_process_message (struct _write_msg *msg) { struct _EMSyncStream *emss = msg->emss; + if (emss->cancel) { + /* Do not pass data to the child if we are canceled. */ + e_flag_set (msg->done); + + return FALSE; + } + /* Force out any pending data before doing anything else. */ if (emss->buffer != NULL && emss->buffer->len > 0) { EMSS_CLASS (emss)->sync_write ( -- cgit