]> git.0d.be Git - empathy.git/commitdiff
Rename _get_selected to _dup_selected and make sure the contact is unrefed.
authorJonny Lamb <jonny.lamb@collabora.co.uk>
Fri, 30 Jan 2009 17:35:40 +0000 (17:35 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 30 Jan 2009 17:35:40 +0000 (17:35 +0000)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=2357

libempathy-gtk/empathy-contact-selector.c
libempathy-gtk/empathy-contact-selector.h
tests/empetit.c

index df5384ace8da80e2a093ec21cb821bd5736d61de..466b590a355f4d9247ac276655f6c3c588051b61 100644 (file)
@@ -320,7 +320,7 @@ empathy_contact_selector_new (EmpathyContactList *contact_list)
 }
 
 EmpathyContact *
-empathy_contact_selector_get_selected (EmpathyContactSelector *selector)
+empathy_contact_selector_dup_selected (EmpathyContactSelector *selector)
 {
   EmpathyContactSelectorPriv *priv = GET_PRIV (selector);
   EmpathyContact *contact = NULL;
index d766c5a62d37df69070d8e56fd13db9de9f4eae1..19ca8cef8609c2b9dd1d20d525a1f010d2cbbdd3 100644 (file)
@@ -58,11 +58,10 @@ struct _EmpathyContactSelectorClass
 };
 
 GType empathy_contact_selector_get_type (void) G_GNUC_CONST;
-GtkWidget *
-empathy_contact_selector_new (EmpathyContactList *contact_list);
 
-EmpathyContact *
-empathy_contact_selector_get_selected (EmpathyContactSelector *selector);
+GtkWidget * empathy_contact_selector_new (EmpathyContactList *contact_list);
+
+EmpathyContact * empathy_contact_selector_dup_selected (EmpathyContactSelector *selector);
 
 G_END_DECLS
 
index 76d0528d8822e0dab00257983c98dc5f9184024a..2d71c5359753e483fa0d13a8354f281f6c117a9c 100644 (file)
@@ -37,12 +37,14 @@ clicked_cb (GtkButton *button,
   EmpathyContactSelector *selector = EMPATHY_CONTACT_SELECTOR (data);
   EmpathyContact *contact;
 
-  contact = empathy_contact_selector_get_selected (selector);
+  contact = empathy_contact_selector_dup_selected (selector);
 
   if (!contact)
     return;
 
   empathy_dispatcher_chat_with_contact (contact, chat_cb, NULL);
+
+  g_object_unref (contact);
 }
 
 int main (int argc,