[empathy] empathy_tp_contact_factory_get_from_{id,	handle} shouldn't pass the ref of the contact to the cb
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: svn-commits-list gnome org
- Cc: 
- Subject: [empathy] empathy_tp_contact_factory_get_from_{id,	handle} shouldn't pass the ref of the contact to the cb
- Date: Mon, 23 Nov 2009 15:01:59 +0000 (UTC)
commit 14e27827e307997db9ec5ad216900cd5282c2864
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Nov 19 11:46:04 2009 +0000
    empathy_tp_contact_factory_get_from_{id,handle} shouldn't pass the ref of the contact to the cb
    
    This match the behaviour of empathy_tp_contact_factory_get_from_{ids,handles}
    and tp_connection_get_contacts_by_handle.
 libempathy/empathy-tp-contact-factory.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-tp-contact-factory.c b/libempathy/empathy-tp-contact-factory.c
index 70bf948..1a8d5fb 100644
--- a/libempathy/empathy-tp-contact-factory.c
+++ b/libempathy/empathy-tp-contact-factory.c
@@ -966,8 +966,12 @@ get_contact_by_id_cb (TpConnection *connection,
 				           error,
 				           data->user_data, weak_object);
 	}
+
+	if (contact != NULL)
+		g_object_unref (contact);
 }
 
+/* The callback is NOT given a reference to the EmpathyContact objects */
 void
 empathy_tp_contact_factory_get_from_id (EmpathyTpContactFactory *tp_factory,
 					const gchar             *id,
@@ -1059,6 +1063,7 @@ empathy_tp_contact_factory_get_from_handles (EmpathyTpContactFactory *tp_factory
 					      weak_object);
 }
 
+/* The callback is NOT given a reference to the EmpathyContact objects */
 static void
 get_contact_by_handle_cb (TpConnection *connection,
 			  guint n_contacts,
@@ -1100,6 +1105,8 @@ get_contact_by_handle_cb (TpConnection *connection,
 	}
 
 	g_clear_error (&err);
+	if (contact != NULL)
+		g_object_unref (contact);
 }
 
 void
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]