summaryrefslogtreecommitdiff
path: root/telepathy-glib/channel-internal.h
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-04-11 12:10:13 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-04-12 11:37:02 +0100
commitaa273c1835bb84766fb9e2b933677ef9fb79dd09 (patch)
tree603f7f05bf87cd5704a712c9953dc0ca24ed85a7 /telepathy-glib/channel-internal.h
parent2e72176e91c5e6b34ffdc2625aa7cd89381e662e (diff)
downloadtelepathy-glib-aa273c1835bb84766fb9e2b933677ef9fb79dd09.tar.gz
channel-contacts: reverse ownership of ContactsQueueItem and result
Previously, the ContactsQueueItem assumed that it owned the only reference to the GSimpleAsyncResult. This could result in the GSAR still existing after the CQI had been freed, if someone else took a reference to the GSAR. Refcounting the CQI would not solve this problem, because then the CQI and the GSAR would have a cyclic reference. Instead, change the queue of CQIs into a queue of GSARs, and have the CQI owned by the GSAR. This means the GSAR's refcounting protects the CQI from being freed prematurely. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'telepathy-glib/channel-internal.h')
-rw-r--r--telepathy-glib/channel-internal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/telepathy-glib/channel-internal.h b/telepathy-glib/channel-internal.h
index 0f13666d2..f8700f29d 100644
--- a/telepathy-glib/channel-internal.h
+++ b/telepathy-glib/channel-internal.h
@@ -88,9 +88,10 @@ struct _TpChannelPrivate {
GHashTable *group_contact_owners;
gboolean cm_too_old_for_contacts;
+ /* Queue of GSimpleAsyncResult with ContactsQueueItem payload */
GQueue *contacts_queue;
/* Item currently being prepared, not part of contacts_queue anymore */
- ContactsQueueItem *current_item;
+ GSimpleAsyncResult *current_contacts_queue_result;
/* NULL, or TpHandle => TpChannelChatState;
* if non-NULL, we're watching for ChatStateChanged */