Re: CORBA_free() question

Hi Chris,

On Tue, 2003-05-27 at 16:32, Chris Wareham wrote:
> I have a utility function which returns an object reference by looking
> it up in the Naming service.

	The Naming service is pure pain to use AFAIR; ;-)

>  I'm just wondering of I need to call
> CORBA_free() on the id and kind fields of the NameComponent. The OMG
> mapping docs are a little bit light on information like that, and I
> can't find any "real world" examples.

	You need to CORBA_free everything you CORBA_allocate, except that is if
you do a deep free, in which case there's no point in freeing the
children. However:

>      name_components[0].id = CORBA_string_dup(id);
>      name_components[0].kind = CORBA_string_dup(kind);

	These dups are not necessary - unless 'name' is an InOut argument ( is
it ? ) - for an in argument one just has to garentee the lifetime of the
strings over the method call.



--  <><, Pseudo Engineer, itinerant idiot

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