Re: Introducing "toggle references"

On Tue, 2005-04-26 at 16:21 +0100, Mark McLoughlin wrote:
> On Tue, 2005-04-26 at 10:59 -0400, Owen Taylor wrote:

> > I'm not sure what you mean by the 'reference' - the reference count?
> 	The pointer to the object we've just taken a reference of - i.e. I'd
> expect it to mirror g_object_ref() rather than gobject_weak_ref().

I don't think this really makes sense ... the g_object_ref() behavior 
is to support the specific idiom of:

 new->foo = g_object_ref (object->foo);

g_object_add_toggle_ref() needs enough other setup around it that I
don't see that returning a pointer to the object would be useful.

> 	Which reminds me - does having GToggleNotify mirroring GWeakNotify
> really help? They seem unnaturally reversed with GWeakNotify, but it
> helps because the data pointer is the most interesting argument to the
> callback in practice (e.g. with g_nullify_pointer()). But with
> GToggleNotify, both arguments are interesting in the callback.

It helps only in the sense that it would be weird to have GToggleNotify
and GWeakNotify right next to each other in the docs, and with different
placement of the user data parameter.


Attachment: signature.asc
Description: This is a digitally signed message part

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