[empathy: 41/80] Don't leak the account and entity



commit dbfd14c60f1748e7608067a082d7a54434317440
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Wed Apr 27 10:41:27 2011 +0100

    Don't leak the account and entity

 libempathy-gtk/empathy-log-window.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 5a391c0..b19d6aa 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -298,13 +298,16 @@ toolbutton_profile_clicked (GtkToolButton *toolbutton,
           -1);
     }
 
-  g_return_if_fail (type == COL_TYPE_NORMAL);
-
-  contact = empathy_contact_from_tpl_contact (account, target);
-  empathy_contact_information_dialog_show (contact,
-      GTK_WINDOW (window->window));
+  if (type == COL_TYPE_NORMAL)
+    {
+      contact = empathy_contact_from_tpl_contact (account, target);
+      empathy_contact_information_dialog_show (contact,
+          GTK_WINDOW (window->window));
+      g_object_unref (contact);
+    }
+  else
+    g_warn_if_reached ();
 
-  g_object_unref (contact);
   g_object_unref (account);
   g_object_unref (target);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]