Bug 22121

Summary: Make tp_channel_dispose idempotent
Product: Telepathy Reporter: Will Thompson <will>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/wjt/telepathy-glib.git;a=shortlog;h=refs/heads/idempotent-dispose
Whiteboard:
i915 platform: i915 features:

Description Will Thompson 2009-06-06 05:22:35 UTC
commit 0cb63c2aecbfb99e091fb4ebf07d85a56266110c
Author: Will Thompson <will.thompson@collabora.co.uk>
Date:   Sat Jun 6 13:18:35 2009 +0100

    Make tp_channel_dispose idempotent

diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c
index 82224ed..e9750b3 100644
--- a/telepathy-glib/channel.c
+++ b/telepathy-glib/channel.c
@@ -1020,6 +1020,9 @@ tp_channel_dispose (GObject *object)
 
   DEBUG ("%p", self);
 
+  if (self->priv->connection == NULL)
+    goto finally;
+
   if (self->priv->conn_invalidated_id != 0)
     g_signal_handler_disconnect (self->priv->connection,
         self->priv->conn_invalidated_id);
@@ -1029,6 +1032,7 @@ tp_channel_dispose (GObject *object)
   g_object_unref (self->priv->connection);
   self->priv->connection = NULL;
 
+finally:
   ((GObjectClass *) tp_channel_parent_class)->dispose (object);
 }
Comment 1 Simon McVittie 2009-06-10 05:35:13 UTC
Approved.
Comment 2 Will Thompson 2009-06-10 07:48:55 UTC
Merged; will be in 0.7.32.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.