[Bug 26205] High-level API for ContactLists

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jun 7 13:46:57 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=26205

--- Comment #22 from Xavier Claessens <xclaesse at gmail.com> 2011-06-07 04:46:55 PDT ---
For the refcycle problem I see 2 possibilities:

1) An intermediary TpContactList object, like Tp::ContactManager:
<smcv> strong refs: contact list -> contact -> connection, contact list ->
connection
 if neither contacts nor the connection ref the contact list, it would fix the
cycles?

That way, user will have to keep strong ref on the TpContactList. if user keeps
only a strong ref on a TpContact but not TpContactList, then the TpContact
object won't update anymore, and any action on it will fail.

This means I would have to change my code to have API like that:

TpContactList *tp_connection_dup_contact_list(TpConnection*self);

void tp_contact_list_prepare_async (TpContactList *self, guint n_features,
TpContactFeature *contact_features);


2) Stop TpContact doing a strong-ref on its TpConnection, and make TpConnection
strong-ref the roster TpContact. This means the user could have to keep a
strong ref on the TpConnection otherwise TpContact objects won't update
anymore, and any action on them will fail.

That way, I can keep the same API as in my branch, but introduce a API break
since existing apps that only keep ref on TpContact but not their TpConnection
will stop working properly.



If this goes together with the breaks for the "telepathy 6.0" plans, I would
personally vote for solution 2. If we want to merge this sooner, then solution
1 is the only choice we have.

Suggestions?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list