summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Ruprecht <mike.ruprecht@collabora.co.uk>2011-05-04 20:51:51 -0500
committerMike Ruprecht <mike.ruprecht@collabora.co.uk>2011-05-04 21:39:55 -0500
commit0d7199c228146e310ac498a748565f9275ef5fdd (patch)
tree9ab7d822a686cc819619e8715f2a6a39f7cb13c0
parent134634a73707d1a6926986cb1f266a4c6ab0de90 (diff)
Fix leak of source object.
g_async_result_get_source_object() refs the source object upon return. It was not being unreffed before. Also, g_simple_async_result_is_valid() ignores the source tag if NULL is passed. This patch simplifies things by calling g_simple_async_result_is_valid() with a NULL source tag, which in effect fixes the leak of the source object as well.
-rw-r--r--telepathy-glib/base-contact-list.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c
index 347279832..c3e816c80 100644
--- a/telepathy-glib/base-contact-list.c
+++ b/telepathy-glib/base-contact-list.c
@@ -801,10 +801,8 @@ tp_base_contact_list_simple_finish (TpBaseContactList *self,
{
GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result;
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
- g_return_val_if_fail (g_async_result_get_source_object (result) ==
- (GObject *) self, FALSE);
- /* not using _is_valid here because we want to be source-tag-agnostic */
+ g_return_val_if_fail (g_simple_async_result_is_valid (
+ result, G_OBJECT (self), NULL), FALSE);
return !g_simple_async_result_propagate_error (simple, error);
}