diff options
author | Milan Crha <mcrha@redhat.com> | 2011-08-03 22:59:22 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-14 20:08:42 +0800 |
commit | 6dec534e63f5ff833c04dbb84bebcd3ace498b5a (patch) | |
tree | 763224bd53b895ba13be7bd91c769b4a1a9115c0 /mail/em-format-html.c | |
parent | fed834bcfd99202ed37ee898a471134947ac4385 (diff) | |
download | gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.tar gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.tar.gz gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.tar.bz2 gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.tar.lz gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.tar.xz gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.tar.zst gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.zip |
Avoid crashes when moving between messages quickly
The itip-formatter part is clean, but the one for attachment_button
can still introduce runtime warnings, which requires more changes and
rethinking of this all, which I prefer to postpone, the best after
WebKit work will land, because it also may change most of the mail
formatting code (I guess). It doesn't crash, at least.
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r-- | mail/em-format-html.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 4a34aa0f28..d79fa450bc 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -157,6 +157,7 @@ struct _format_msg { CamelFolder *folder; gchar *uid; CamelMimeMessage *message; + gboolean cancelled; }; static gchar * @@ -177,8 +178,10 @@ efh_format_exec (struct _format_msg *m, CamelURL *base; gchar *content; - if (m->format->priv->web_view == NULL) + if (m->format->priv->web_view == NULL) { + m->cancelled = TRUE; return; + } format = EM_FORMAT (m->format); stream = CAMEL_STREAM (m->estream); @@ -265,6 +268,10 @@ efh_format_exec (struct _format_msg *m, (CamelStream *) m->estream, "</body>\n</html>\n", cancellable, NULL); camel_stream_close ((CamelStream *) m->estream, cancellable, NULL); + if (g_cancellable_is_cancelled (cancellable)) { + m->cancelled = TRUE; + m->estream->sync.cancel = TRUE; + } g_object_unref (m->estream); m->estream = NULL; } @@ -274,6 +281,7 @@ efh_format_exec (struct _format_msg *m, d(printf("out of jobs, done\n")); format->pending_uri_level = puri_level; + m->cancelled = m->cancelled || g_cancellable_is_cancelled (cancellable); } static void @@ -294,6 +302,8 @@ efh_format_free (struct _format_msg *m) g_object_unref (m->format); if (m->estream) { camel_stream_close ((CamelStream *) m->estream, NULL, NULL); + if (m->cancelled) + m->estream->sync.cancel = TRUE; g_object_unref (m->estream); } if (m->folder) |