[empathy] filter_func: don't leak individual
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] filter_func: don't leak individual
- Date: Wed, 18 May 2011 13:41:04 +0000 (UTC)
commit 259126957650f1c28abdbc101636fe5cbca03f48
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue May 17 10:06:50 2011 +0200
filter_func: don't leak individual
src/empathy-invite-participant-dialog.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c
index bdae6bf..379b231 100644
--- a/src/empathy-invite-participant-dialog.c
+++ b/src/empathy-invite-participant-dialog.c
@@ -167,7 +167,7 @@ filter_func (GtkTreeModel *model,
TpContact *contact;
gboolean is_online;
GList *members, *l;
- gboolean display;
+ gboolean display = FALSE;
TpChannel *channel;
gtk_tree_model_get (model, iter,
@@ -176,13 +176,14 @@ filter_func (GtkTreeModel *model,
-1);
if (individual == NULL || !is_online)
- return FALSE;
+ goto out;
/* Filter out individuals not having a persona on the same connection as the
* EmpathyTpChat. */
contact = get_tp_contact_for_chat (self, individual);
+
if (contact == NULL)
- return FALSE;
+ goto out;
/* Filter out contacts which are already in the chat */
members = empathy_contact_list_get_members (EMPATHY_CONTACT_LIST (
@@ -212,6 +213,8 @@ filter_func (GtkTreeModel *model,
g_list_foreach (members, (GFunc) g_object_unref, NULL);
g_list_free (members);
+out:
+ tp_clear_object (&individual);
return display;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]