Bug 22121 - Make tp_channel_dispose idempotent
Summary: Make tp_channel_dispose idempotent
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/wj...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-06-06 05:22 UTC by Will Thompson
Modified: 2009-06-10 07:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.