[empathy] use tp_clear_object()



commit cf25437b4330f128f0d35e97a353824177736c53
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Feb 7 13:13:20 2011 +0100

    use tp_clear_object()

 libempathy/empathy-tp-file.c |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index cdb3bfa..d69b215 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -95,8 +95,6 @@ struct _EmpathyTpFilePrivate {
 
   gboolean is_closing;
   gboolean is_closed;
-
-  gboolean dispose_run;
 };
 
 enum {
@@ -702,27 +700,16 @@ do_dispose (GObject *object)
 {
   EmpathyTpFile *self = (EmpathyTpFile *) object;
 
-  if (self->priv->dispose_run)
-    return;
-
-  self->priv->dispose_run = TRUE;
-
   if (self->priv->channel != NULL)
     {
       g_signal_handlers_disconnect_by_func (self->priv->channel,
           tp_file_invalidated_cb, object);
-      g_object_unref (self->priv->channel);
-      self->priv->channel = NULL;
+      tp_clear_object (&self->priv->channel);
     }
 
-  if (self->priv->in_stream != NULL)
-    g_object_unref (self->priv->in_stream);
-
-  if (self->priv->out_stream != NULL)
-    g_object_unref (self->priv->out_stream);
-
-  if (self->priv->cancellable != NULL)
-    g_object_unref (self->priv->cancellable);
+  tp_clear_object (&self->priv->in_stream);
+  tp_clear_object (&self->priv->out_stream);
+  tp_clear_object (&self->priv->cancellable);
 
   G_OBJECT_CLASS (empathy_tp_file_parent_class)->dispose (object);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]