From 155c260f5a7ef39c5f1403e024363844cc67a0f2 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 7 Feb 2011 13:13:20 +0100 Subject: use tp_clear_object() --- libempathy/empathy-tp-file.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index cdb3bfab9..d69b2153a 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); } -- cgit v1.2.3