From 9d298ba6b67ea515cc1b2dfa201e8f89671b87cb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 22 Apr 2014 12:50:04 +0100 Subject: GabbleRoster: set priv->conn before chaining up The parent constructed() callback calls can_block(), and our implementation of can_block() needs the connection, so we need to do that first. --- src/roster.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/roster.c b/src/roster.c index ed4cb118a..87f0610aa 100644 --- a/src/roster.c +++ b/src/roster.c @@ -1865,19 +1865,21 @@ gabble_roster_constructed (GObject *obj) ((GObjectClass *) gabble_roster_parent_class)->constructed; TpHandleRepoIface *contact_repo; - if (chain_up != NULL) - chain_up (obj); - /* FIXME: This is not a strong reference because that would create a cycle. * I'd like to have a cyclic reference and break it at disconnect time, * like the contact list example in telepathy-glib does, but we can't do * that because the rest of Gabble assumes that the roster remains useful * until the bitter end (for instance, gabble_im_channel_dispose looks - * at the contact's subscription). */ + * at the contact's subscription). + * + * Set this before chaining up, so can_block() can use it. */ self->priv->conn = GABBLE_CONNECTION (tp_base_contact_list_get_connection ( base, NULL)); g_assert (GABBLE_IS_CONNECTION (self->priv->conn)); + if (chain_up != NULL) + chain_up (obj); + contact_repo = tp_base_connection_get_handles ( (TpBaseConnection *) self->priv->conn, TP_ENTITY_TYPE_CONTACT); -- cgit v1.2.3