summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-12-07 18:57:20 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-12-08 13:08:17 +0000
commit5546500bb83d4e1315a958b22c354efec1f22456 (patch)
tree0bb7331611bc147dc2cb6f2a6ccc4fcd69770ff2
parentcbd79049b86bc1361952ec2733ee2ed81358ff36 (diff)
contacts_get_attributes: don't hold handles if we don't still need to
-rw-r--r--telepathy-glib/contact.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 9d4be6cbc..04fa0dac0 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -2871,10 +2871,8 @@ contacts_got_attributes (TpConnection *connection,
i = 0;
- if (c->signature == CB_BY_HANDLE)
+ if (c->signature == CB_BY_HANDLE && c->contacts->len == 0)
{
- g_assert (c->contacts->len == 0);
-
while (i < c->handles->len)
{
TpHandle handle = g_array_index (c->handles, guint, i);
@@ -3099,12 +3097,13 @@ contacts_get_attributes (ContactsContext *context)
g_ptr_array_add (array, NULL);
supported_interfaces = (const gchar **) g_ptr_array_free (array, FALSE);
- /* we want to hold the handles if and only if the call is by_handle -
- * for the other modes, we already have handles */
+ /* The Hold parameter is only true if we started from handles, and we don't
+ * already have all the contacts we need. */
context->refcount++;
tp_connection_get_contact_attributes (context->connection, -1,
context->handles->len, (const TpHandle *) context->handles->data,
- supported_interfaces, (context->signature == CB_BY_HANDLE),
+ supported_interfaces,
+ (context->signature == CB_BY_HANDLE && context->contacts->len == 0),
contacts_got_attributes,
context, contacts_context_unref, context->weak_object);
g_free (supported_interfaces);