summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-22 12:50:04 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-22 14:30:56 +0100
commit9d298ba6b67ea515cc1b2dfa201e8f89671b87cb (patch)
treeb79ca829a95f379d429c5f96c3032400c377db26
parentab83c3b6dd634c06d030d7cb3d7761bb4b7f81ea (diff)
GabbleRoster: set priv->conn before chaining upgdbus-object
The parent constructed() callback calls can_block(), and our implementation of can_block() needs the connection, so we need to do that first.
-rw-r--r--src/roster.c10
1 files 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);