From a8b43f12d30d58df745a265577677a05f66d2080 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 1 Oct 2007 12:56:30 +0000 Subject: Fix refcounting of priv->factory. Fixes bug #473116. 2007-10-01 Xavier Claessens * libempathy-gtk/empathy-private-chat.c: Fix refcounting of priv->factory. Fixes bug #473116. svn path=/trunk/; revision=350 --- ChangeLog | 5 +++++ libempathy-gtk/empathy-private-chat.c | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6522a34e..bb398fa0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-01 Xavier Claessens + + * libempathy-gtk/empathy-private-chat.c: Fix refcounting of + priv->factory. Fixes bug #473116. + 2007-10-01 Xavier Claessens * libempathy-gtk/empathy-chat-window.c: Adding sanity checks to public 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); -- cgit v1.2.3