From 922960e53b98db8d3363a859719362f0a722a1fd Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 5 Jul 2010 17:11:34 +0100 Subject: [PATCH] Connect cancellable earlier in tp_contact_request_contact_info_async() The call to tp_cli_connection_interface_contact_info_call_request_contact_info() returns synchronously in the error condition, meaning the cancellable connection is redundant. Also make the async operation complete in an idle callback rather than synchronously in this case. Fixes: bfo#27792 --- telepathy-glib/contact.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index 1622a81..7e67f28 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -2554,7 +2554,7 @@ contact_info_request_cb (TpConnection *connection, contact_maybe_set_info (self, contact_info); } - g_simple_async_result_complete (data->result); + g_simple_async_result_complete_in_idle (data->result); data->call = NULL; } @@ -2637,12 +2637,6 @@ tp_contact_request_contact_info_async (TpContact *self, data->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_contact_request_contact_info_finish); - data->call = tp_cli_connection_interface_contact_info_call_request_contact_info ( - self->priv->connection, 60*60*1000, self->priv->handle, - contact_info_request_cb, - data, (GDestroyNotify) contact_info_request_data_free, - NULL); - if (cancellable != NULL) { data->cancellable = g_object_ref (cancellable); @@ -2650,6 +2644,11 @@ tp_contact_request_contact_info_async (TpContact *self, G_CALLBACK (contact_info_request_cancelled_cb), data, NULL); } + data->call = tp_cli_connection_interface_contact_info_call_request_contact_info ( + self->priv->connection, 60*60*1000, self->priv->handle, + contact_info_request_cb, + data, (GDestroyNotify) contact_info_request_data_free, + NULL); } /** -- 1.7.1