Re: glist manipulation and reference count



On Fri, 2009-05-15 at 19:42 +0200, Sven Neumann wrote:
> Hi,
> 
> On Thu, 2009-05-14 at 20:47 -0700, walty wrote:
> 
> > However, one thing that surprised me is that, when I do "g_list_append" or
> > "g_list_prepend", it does not automatically add the reference count of the
> > stored GObject (unlike objective-C). 
> 
> It would be nice to have some container implementations in GObject that
> deal with reference counting automatically. 

We recently got that for GPtrArray (insofar you can pass g_object_unref
to g_ptr_array_set_free_func()), see

 http://bugzilla.gnome.org/show_bug.cgi?id=580450

which is in GLib 2.21 already. The other half of this work is

 http://bugzilla.gnome.org/show_bug.cgi?id=581106

which I'm hoping to get committed as well.

> The classes found in libgee
> http://live.gnome.org/Libgee could serve as a starting point.

There's been a couple of very heated discussions about this on this list
and in bug 560061. It seems like the GLib maintainers don't want things
like this.

     David




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]