From e7981244a68c9d0b6b93d8c2697569668098b647 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 25 Oct 2012 08:04:19 -0400 Subject: Bug 686813 - ECaldavChooser: Deadlock on cancellation --- modules/cal-config-caldav/e-caldav-chooser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/cal-config-caldav') diff --git a/modules/cal-config-caldav/e-caldav-chooser.c b/modules/cal-config-caldav/e-caldav-chooser.c index b4c51a94bc..30aa8fffd5 100644 --- a/modules/cal-config-caldav/e-caldav-chooser.c +++ b/modules/cal-config-caldav/e-caldav-chooser.c @@ -940,9 +940,14 @@ caldav_chooser_calendar_home_set_cb (SoupSession *session, doc = caldav_chooser_parse_xml (message, "multistatus", &error); + /* If we were cancelled then we're in a GCancellable::cancelled + * signal handler right now and GCancellable has its mutex locked, + * which means calling g_cancellable_disconnect() now will deadlock + * when it too tries to acquire the mutex. So defer the GAsyncResult + * completion to an idle callback to avoid this deadlock. */ if (error != NULL) { g_simple_async_result_set_from_error (simple, error); - g_simple_async_result_complete (simple); + g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); g_error_free (error); return; -- cgit v1.2.3