]> git.0d.be Git - empathy.git/commitdiff
tp_chat_got_renamed_contacts_cb: use tp_clear_object() to unref priv->user
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 23 Mar 2011 13:26:29 +0000 (14:26 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 23 Mar 2011 13:26:41 +0000 (14:26 +0100)
If priv->user and old are both NULL, we used to crash.

libempathy/empathy-tp-chat.c

index 86aca446b6ab7a8241dad96aebd4307cfa5b5087..6d29807e40466d045c68645faed76a5912d1f231 100644 (file)
@@ -1090,7 +1090,7 @@ tp_chat_got_renamed_contacts_cb (TpConnection            *connection,
 
        if (priv->user == old) {
                /* We change our nick */
-               g_object_unref (priv->user);
+               tp_clear_object (&priv->user);
                priv->user = g_object_ref (new);
        }