From de0ad19d14d6b0a242639a10ea660ff2aa4bd0d2 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 13 Jul 2010 14:46:07 +0100 Subject: [PATCH] Don't leak TpfPersona references for each Individual Due to bgo#624249, GLib.List.remove() leaks an item reference, so we need to manually unreference each persona we remove from the personas list in Individual. --- folks/individual.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/folks/individual.vala b/folks/individual.vala index 395c7bb..26652d6 100644 --- a/folks/individual.vala +++ b/folks/individual.vala @@ -320,6 +320,11 @@ public class Folks.Individual : Object, foreach (var persona in persona_set) { this._personas.remove (persona); + /* FIXME: bgo#624249 means GLib.List leaks item references. + * We probably eventually want to transition away from GLib.List + * and use Gee.LinkedList, but that would mean exposing libgee + * in the public API. */ + g_object_unref (persona); } } if (store != null) @@ -348,6 +353,8 @@ public class Folks.Individual : Object, persona_set.remove (p); this._personas.remove (p); + /* FIXME: bgo#624249 means GLib.List leaks item references */ + g_object_unref (p); }); if (this._personas.length () < 1) -- 2.7.4