[telepathy-gabble/master] Ref FT's target and initiator handles
Will Thompson
will.thompson at collabora.co.uk
Tue Mar 24 16:01:32 PDT 2009
---
src/file-transfer-channel.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/file-transfer-channel.c b/src/file-transfer-channel.c
index 86bf8f9..da6d405 100644
--- a/src/file-transfer-channel.c
+++ b/src/file-transfer-channel.c
@@ -428,16 +428,16 @@ gabble_file_transfer_channel_constructor (GType type,
/* Parent constructor chain */
obj = G_OBJECT_CLASS (gabble_file_transfer_channel_parent_class)->
constructor (type, n_props, props);
-
self = GABBLE_FILE_TRANSFER_CHANNEL (obj);
-
- /* Ref our handle */
base_conn = TP_BASE_CONNECTION (self->priv->connection);
+ /* Ref the target and initiator handles; they can't be reffed in
+ * _set_property as we may not have the TpConnection at that point.
+ */
contact_repo = tp_base_connection_get_handles (base_conn,
TP_HANDLE_TYPE_CONTACT);
-
tp_handle_ref (contact_repo, self->priv->handle);
+ tp_handle_ref (contact_repo, self->priv->initiator);
self->priv->object_path = g_strdup_printf ("%s/FileTransferChannel/%p",
base_conn->object_path, self);
@@ -762,6 +762,7 @@ gabble_file_transfer_channel_dispose (GObject *object)
self->priv->dispose_has_run = TRUE;
tp_handle_unref (handle_repo, self->priv->handle);
+ tp_handle_unref (handle_repo, self->priv->initiator);
gabble_file_transfer_channel_do_close (self);
--
1.5.6.5
More information about the telepathy-commits
mailing list