CORBA_free() question



I have a utility function which returns an object reference by looking
it up in the Naming service. 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.

                              -oOo-

CosNaming_NamingContext naming_context;

CORBA_Object
get_object(const char *id, const char *kind)
{
     CosNaming_NameComponent name_components[1];
     CosNaming_Name name = { 1, 1, name_components, CORBA_FALSE };
     CORBA_Environment ev;
     CORBA_Object obj;

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

     CORBA_exception_init(&ev);

     obj = CosNaming_NamingContext_resolve(naming_context, &name, &ev);

     CORBA_exception_free(&ev);

     return obj;
}

                              -oOo-

Chris
-- 
chris.wareham@iosystems.co.uk (work)
chris.wareham@btopenworld.com (home)




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