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 /plugins | |
parent | fed834bcfd99202ed37ee898a471134947ac4385 (diff) | |
download | gsoc2013-evolution-6dec534e63f5ff833c04dbb84bebcd3ace498b5a.tar.gz 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 'plugins')
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 46b7abb3a3..82bc373de7 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -803,8 +803,9 @@ get_object_without_rid_ready_cb (GObject *source_object, GAsyncResult *result, g icalcomp = NULL; if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || - g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_error_free (error); + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || + g_cancellable_is_cancelled (fd->cancellable)) { + g_clear_error (&error); find_cal_update_ui (fd, cal_client); decrease_find_data (fd); return; @@ -843,7 +844,8 @@ get_object_with_rid_ready_cb (GObject *source_object, GAsyncResult *result, gpoi icalcomp = NULL; if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || - g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || + g_cancellable_is_cancelled (fd->cancellable)) { g_error_free (error); find_cal_update_ui (fd, cal_client); decrease_find_data (fd); @@ -887,6 +889,12 @@ get_object_list_ready_cb (GObject *source_object, GAsyncResult *result, gpointer if (!e_cal_client_get_object_list_finish (cal_client, result, &objects, &error)) objects = NULL; + if (g_cancellable_is_cancelled (fd->cancellable)) { + g_clear_error (&error); + decrease_find_data (fd); + return; + } + if (error) { if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { @@ -926,6 +934,12 @@ find_cal_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_ } } + if (g_cancellable_is_cancelled (fd->cancellable)) { + g_clear_error (&error); + decrease_find_data (fd); + return; + } + if (error) { /* FIXME Do we really want to warn here? If we fail * to find the item, this won't be cleared but the |