[Telepathy-commits] [telepathy-glib/master] base_conn_dispose: don't assert self_handle == 0

Will Thompson will.thompson at collabora.co.uk
Fri Nov 21 05:27:14 PST 2008


Instead, unref it if it is non-zero.  This fixes #18151, which occurs if the CM
sets the self_handle then is destroyed without moving to state Disconnected (at
which point self_handle is set to 0 if it is not already), and is half of a fix
to #17751.
---
 telepathy-glib/base-connection.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 8394f4c..916c40a 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -487,7 +487,12 @@ tp_base_connection_dispose (GObject *object)
 
   g_assert ((self->status == TP_CONNECTION_STATUS_DISCONNECTED) ||
             (self->status == TP_INTERNAL_CONNECTION_STATUS_NEW));
-  g_assert (self->self_handle == 0);
+  if (self->self_handle != 0)
+    {
+      tp_handle_unref (self->priv->handles[TP_HANDLE_TYPE_CONTACT],
+              self->self_handle);
+      self->self_handle = 0;
+    }
 
   if (NULL != self->bus_name)
     {
-- 
1.5.6.5



More information about the Telepathy-commits mailing list