Re: GBoxed with reference-counted objects



On Sat, 2007-10-27 at 08:51 -0400, Phil Lello wrote:
> Hi all,
> 
> I'm implementing a GtkWidget derived widget with a GAsyncQueue as a
> property. GAsyncQueue implements reference counting, but isn't derived
> from GObject. It has been suggested that I wrap this in a GBoxed type,
> and use GParamSpecBoxed.
> 
> If my GBoxedCopyFunc simply increases the reference count, is this what
> people expect from a 'copy'?

There are boxed types in pango that do exactly that.  So I guess it's
ok.

> If not, would it be better to add a parallel to GBoxedXXX, say
> GRefCountedXXX, for non-GObject-derived, reference-counted objects?
> These would then take a GRefCountedRef and GRefCountedUnref. This could
> all be done by #define's, but with the distinction that people would
> know they had access to a shared object, not a private copy.
> 
> Please let me know your thoughts,
> 
> Phil Lello

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





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