[Telepathy-commits] [telepathy-gabble/master] GabbleMediaSession: ref the peer handle for the duration. We can't rely on it being reffed by the channel's group interface any more, with telepathy-spec 0.17.3 semantics

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Aug 19 10:51:56 PDT 2008


20080430153222-53eee-1f2bdc70acbce3bda9be817dcf49b8e00fd2b7e4.gz
---
 src/gabble-media-session.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/gabble-media-session.c b/src/gabble-media-session.c
index 34a203f..aa3199d 100644
--- a/src/gabble-media-session.c
+++ b/src/gabble-media-session.c
@@ -296,6 +296,7 @@ gabble_media_session_constructor (GType type, guint n_props,
   GObject *obj;
   GabbleMediaSessionPrivate *priv;
   DBusGConnection *bus;
+  TpHandleRepoIface *contact_handles;
 
   obj = G_OBJECT_CLASS (gabble_media_session_parent_class)->
            constructor (type, n_props, props);
@@ -304,6 +305,11 @@ gabble_media_session_constructor (GType type, guint n_props,
   bus = tp_get_bus ();
   dbus_g_connection_register_g_object (bus, priv->object_path, obj);
 
+  contact_handles = tp_base_connection_get_handles (
+      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+
+  tp_handle_ref (contact_handles, priv->peer);
+
   return obj;
 }
 
@@ -530,6 +536,7 @@ gabble_media_session_dispose (GObject *object)
   GabbleMediaSession *self = GABBLE_MEDIA_SESSION (object);
   GabbleMediaSessionPrivate *priv = GABBLE_MEDIA_SESSION_GET_PRIVATE (self);
   guint i;
+  TpHandleRepoIface *contact_handles;
 
   DEBUG ("called");
 
@@ -557,6 +564,11 @@ gabble_media_session_dispose (GObject *object)
   g_ptr_array_free (priv->remove_requests, TRUE);
   priv->remove_requests = NULL;
 
+  contact_handles = tp_base_connection_get_handles (
+      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+
+  tp_handle_unref (contact_handles, priv->peer);
+
   if (G_OBJECT_CLASS (gabble_media_session_parent_class)->dispose)
     G_OBJECT_CLASS (gabble_media_session_parent_class)->dispose (object);
 }
-- 
1.5.6.3




More information about the Telepathy-commits mailing list