]> git.0d.be Git - empathy.git/commitdiff
tp_chat_dispose: use tp_clear_object()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 19 May 2011 11:39:17 +0000 (13:39 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 25 May 2011 07:22:42 +0000 (09:22 +0200)
libempathy/empathy-tp-chat.c

index f60b5ef3de3456fc7efbdb8fd532520f7ecbaa6b..34e2d40b271b01975b3309704b791b90f5a2eba6 100644 (file)
@@ -39,7 +39,6 @@
 #include "empathy-debug.h"
 
 struct _EmpathyTpChatPrivate {
-       gboolean               dispose_has_run;
        TpAccount             *account;
        EmpathyContact        *user;
        EmpathyContact        *remote_contact;
@@ -815,20 +814,9 @@ tp_chat_dispose (GObject *object)
 {
        EmpathyTpChat *self = EMPATHY_TP_CHAT (object);
 
-       if (self->priv->dispose_has_run)
-               return;
-
-       self->priv->dispose_has_run = TRUE;
-
        tp_clear_object (&self->priv->account);
-
-       if (self->priv->remote_contact != NULL)
-               g_object_unref (self->priv->remote_contact);
-       self->priv->remote_contact = NULL;
-
-       if (self->priv->user != NULL)
-               g_object_unref (self->priv->user);
-       self->priv->user = NULL;
+       tp_clear_object (&self->priv->remote_contact);
+       tp_clear_object (&self->priv->user);
 
        g_queue_foreach (self->priv->messages_queue, (GFunc) g_object_unref, NULL);
        g_queue_clear (self->priv->messages_queue);