Re: Proposal: Ref Counting Conventions (CLOSED)



Miguel de Icaza <miguel@helixcode.com> writes:

> Darin,
> 
>    You raise a good point, and I think we need to continue the debate
> from where we are now.
> 
>    Michael's proposal only covers the CORBA level: how reference
> counting works at the Bonobo::Unknown level.  It does not cover other
> uses of it.  Ie, the reference counting applies to objects that are
> returned over a CORBA call boundary.
> 
>    For instance:
> 
> >     bonobo_object_from_servant
> >     bonobo_object_get_servant
> >     bonobo_object_activate_servant
> >     bonobo_object_corba_objref
> 
>    These are utility functions from the CORBA/Gtk merging land: none
> of those return objects that were returned from a remote component,
> they are simply routines that return the values you already "own".
> 
>    Besides object_from_servant is again, just a utility function that
> maps the CORBA servants to the CORBA object references.
> 
> >     bonobo_embeddable_construct_full
> >     bonobo_embeddable_construct
> 
> These again, do not invoke any remote methods.  Note that these
> methods return the GtkObject fully constructed or NULL.  They do not
> return a Bonobo_Unkonwn that was returned from a remote method or
> CORBA_OBJECT_NIL. 
> 

I already know what Darin's objection is going to be, so I'll state it
for him.

Drawing the distinction this way requires client code to know which
GtkObject methods invoke CORBA methods; thus, it's still necessary to
know method-specific information to see at a glance if refcounting in
the code is correct. This pratly defeats the purpose of having the
refcounting convention in the first place.

I do agree that making the methods mentioned ref the return value
would be extremely weird however.

 - Maciej




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