]> git.0d.be Git - empathy.git/commitdiff
Fix refcounting of priv->factory. Fixes bug #473116.
authorXavier Claessens <xclaesse@gmail.com>
Mon, 1 Oct 2007 12:56:30 +0000 (12:56 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Mon, 1 Oct 2007 12:56:30 +0000 (12:56 +0000)
2007-10-01  Xavier Claessens  <xclaesse@gmail.com>

* libempathy-gtk/empathy-private-chat.c: Fix refcounting of
priv->factory. Fixes bug #473116.

svn path=/trunk/; revision=350

ChangeLog
libempathy-gtk/empathy-private-chat.c

index a6522a34e1bfa1849ca5ee2994a670d5a20ac9fd..bb398fa0a63d89f708282725489bcc2a5738802a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-01  Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy-gtk/empathy-private-chat.c: Fix refcounting of
+       priv->factory. Fixes bug #473116.
+
 2007-10-01  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-chat-window.c: Adding sanity checks to public
index b187e98cdb2c1665813fc038dff06a196eb2c685..30f46ad8bf0d2dc1fe187d1350799d3c0143e049 100644 (file)
@@ -333,27 +333,24 @@ empathy_private_chat_new (McAccount *account,
        EmpathyPrivateChat     *chat;
        EmpathyPrivateChatPriv *priv;
        EmpathyTpChat          *tp_chat;
-       EmpathyContactFactory  *factory;
        EmpathyContact         *contact;
 
        g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
        g_return_val_if_fail (TELEPATHY_IS_CHAN (tp_chan), NULL);
 
-       factory = empathy_contact_factory_new ();
-       contact = empathy_contact_factory_get_from_handle (factory,
-                                                          account,
-                                                          tp_chan->handle);
-
        chat = g_object_new (EMPATHY_TYPE_PRIVATE_CHAT, NULL);
        priv = GET_PRIV (chat);
 
-       priv->factory = factory;
+       priv->factory = empathy_contact_factory_new ();
+       contact = empathy_contact_factory_get_from_handle (priv->factory,
+                                                          account,
+                                                          tp_chan->handle);
+
        tp_chat = empathy_tp_chat_new (account, tp_chan);
        private_chat_setup (chat, contact, tp_chat);
 
        g_object_unref (tp_chat);
        g_object_unref (contact);
-       g_object_unref (factory);
 
        return chat;
 }
@@ -361,14 +358,18 @@ empathy_private_chat_new (McAccount *account,
 EmpathyPrivateChat *
 empathy_private_chat_new_with_contact (EmpathyContact *contact)
 {
-       EmpathyPrivateChat *chat;
-       EmpathyTpChat      *tp_chat;
+       EmpathyPrivateChat     *chat;
+       EmpathyPrivateChatPriv *priv;
+       EmpathyTpChat          *tp_chat;
 
        g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
 
        chat = g_object_new (EMPATHY_TYPE_PRIVATE_CHAT, NULL);
-       tp_chat = empathy_tp_chat_new_with_contact (contact);
 
+       priv = GET_PRIV (chat);
+       priv->factory = empathy_contact_factory_new ();
+
+       tp_chat = empathy_tp_chat_new_with_contact (contact);
        private_chat_setup (chat, contact, tp_chat);
        g_object_unref (tp_chat);