aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-10-01 20:56:30 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-10-01 20:56:30 +0800
commita8b43f12d30d58df745a265577677a05f66d2080 (patch)
tree4dca1127da4c09a90ac8fdb148e8a0a9654a3ab4 /libempathy-gtk
parente7731797506c69ab97ae6f758cc3ec1b6557456b (diff)
downloadgsoc2013-empathy-a8b43f12d30d58df745a265577677a05f66d2080.tar
gsoc2013-empathy-a8b43f12d30d58df745a265577677a05f66d2080.tar.gz
gsoc2013-empathy-a8b43f12d30d58df745a265577677a05f66d2080.tar.bz2
gsoc2013-empathy-a8b43f12d30d58df745a265577677a05f66d2080.tar.lz
gsoc2013-empathy-a8b43f12d30d58df745a265577677a05f66d2080.tar.xz
gsoc2013-empathy-a8b43f12d30d58df745a265577677a05f66d2080.tar.zst
gsoc2013-empathy-a8b43f12d30d58df745a265577677a05f66d2080.zip
Fix refcounting of priv->factory. Fixes bug #473116.
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
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-private-chat.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-private-chat.c b/libempathy-gtk/empathy-private-chat.c
index b187e98cd..30f46ad8b 100644
--- a/libempathy-gtk/empathy-private-chat.c
+++ b/libempathy-gtk/empathy-private-chat.c
@@ -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);