[Bug 32053] Add a TpContactSearch proxy object

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Dec 14 14:25:28 CET 2010


https://bugs.freedesktop.org/show_bug.cgi?id=32053

--- Comment #19 from Emilio Pozuelo Monfort <pochu27 at gmail.com> 2010-12-14 05:25:27 PST ---
(In reply to comment #18)
> (In reply to comment #17)
> 
> > Done, I'm now returning a GList<TpContactSearchResult>. Should I register that
> > as a new boxed type and make the signal know the type, instead of a
> > G_TYPE_POINTER, to not leak the objects in the list?
> 
> Since it's a signal, you don't need to register a new type, it doesn't matter.
> You are, however, responsible for cleaning up whatever you create after
> g_signal_emit() [non-event signals are synchronous].

Oh, I thought it was async.

> Thus you want a g_list_foreach(g_object_unref); g_list_free(); pair.

Fixed using g_list_free_full (list, g_object_unref).

> +      results = g_list_append (results, search_result);
> 
> Using g_list_prepend() followed by an optional g_list_reverse() will always be
> faster. O(2n) vs O(n^2).

Thanks for the tip, fixed (with O(n) since I'm not doing the _reverse()).

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list