aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-mt.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-09-21 11:13:43 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-09-28 23:35:55 +0800
commit31b57ed0383b2ea225195d4b72a872f7f2d93163 (patch)
tree2d70adcce04ed1ed5111c06cd7ad93266419b0e0 /mail/mail-mt.c
parenta91eeb647138ee035444cdc3c265fa4e95898f29 (diff)
downloadgsoc2013-evolution-31b57ed0383b2ea225195d4b72a872f7f2d93163.tar
gsoc2013-evolution-31b57ed0383b2ea225195d4b72a872f7f2d93163.tar.gz
gsoc2013-evolution-31b57ed0383b2ea225195d4b72a872f7f2d93163.tar.bz2
gsoc2013-evolution-31b57ed0383b2ea225195d4b72a872f7f2d93163.tar.lz
gsoc2013-evolution-31b57ed0383b2ea225195d4b72a872f7f2d93163.tar.xz
gsoc2013-evolution-31b57ed0383b2ea225195d4b72a872f7f2d93163.tar.zst
gsoc2013-evolution-31b57ed0383b2ea225195d4b72a872f7f2d93163.zip
Adapt to Camel API changes.
Diffstat (limited to 'mail/mail-mt.c')
-rw-r--r--mail/mail-mt.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 694a8f5abe..87f6b251bf 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -298,16 +298,24 @@ void
mail_msg_cancel (guint msgid)
{
MailMsg *msg;
+ GCancellable *cancellable = NULL;
g_mutex_lock (mail_msg_lock);
msg = g_hash_table_lookup (
mail_msg_active_table, GINT_TO_POINTER (msgid));
- if (msg != NULL && msg->cancellable != NULL)
- camel_operation_cancel (CAMEL_OPERATION (msg->cancellable));
+ /* Hold a reference to the GCancellable so it doesn't finalize
+ * itself on us between unlocking the mutex and cancelling. */
+ if (msg != NULL && !g_cancellable_is_cancelled (msg->cancellable))
+ cancellable = g_object_ref (msg->cancellable);
g_mutex_unlock (mail_msg_lock);
+
+ if (cancellable != NULL) {
+ camel_operation_cancel (CAMEL_OPERATION (cancellable));
+ g_object_unref (cancellable);
+ }
}
/* waits for a message to be finished processing (freed)
@@ -474,7 +482,7 @@ mail_msg_proxy (MailMsg *msg)
{
if (msg->info->desc != NULL) {
gchar *text = msg->info->desc (msg);
- camel_operation_start (msg->cancellable, "%s", text);
+ camel_operation_push_message (msg->cancellable, "%s", text);
g_free (text);
}
@@ -488,7 +496,7 @@ mail_msg_proxy (MailMsg *msg)
msg->info->exec (msg);
if (msg->info->desc != NULL)
- camel_operation_end (msg->cancellable);
+ camel_operation_pop_message (msg->cancellable);
g_async_queue_push (msg_reply_queue, msg);