From 4df45fb806fdb78acbbca7e704780d427f11df2f Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Fri, 30 Jan 2009 17:35:40 +0000 Subject: [PATCH] Rename _get_selected to _dup_selected and make sure the contact is unrefed. Signed-off-by: Jonny Lamb svn path=/trunk/; revision=2357 --- libempathy-gtk/empathy-contact-selector.c | 2 +- libempathy-gtk/empathy-contact-selector.h | 7 +++---- tests/empetit.c | 4 +++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c index df5384ac..466b590a 100644 --- a/libempathy-gtk/empathy-contact-selector.c +++ b/libempathy-gtk/empathy-contact-selector.c @@ -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; diff --git a/libempathy-gtk/empathy-contact-selector.h b/libempathy-gtk/empathy-contact-selector.h index d766c5a6..19ca8cef 100644 --- a/libempathy-gtk/empathy-contact-selector.h +++ b/libempathy-gtk/empathy-contact-selector.h @@ -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 diff --git a/tests/empetit.c b/tests/empetit.c index 76d0528d..2d71c535 100644 --- a/tests/empetit.c +++ b/tests/empetit.c @@ -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, -- 2.39.2