Re: --skeleton_impl question



Jules Colding wrote:

>To sum it up - I think that I should use duplicate() in the code snippet
>above on my root POA reference and then explicitly release() the
>reference in the destructor.
>  
>
I agree, changes have been checked in.
Constructor/Desctructor of newly generated *-skelimpl.c files now will 
look like:

/*** Stub implementations ***/

static Examples_ByteSeq_Storage
impl_Examples_ByteSeq_Storage__create(PortableServer_POA poa,
                      CORBA_Environment * ev)
{
   Examples_ByteSeq_Storage retval;
   impl_POA_Examples_ByteSeq_Storage *newservant;
   PortableServer_ObjectId *objid;

   newservant = g_new0(impl_POA_Examples_ByteSeq_Storage, 1);
   newservant->servant.vepv = &impl_Examples_ByteSeq_Storage_vepv;
   newservant->poa =
      (PortableServer_POA) CORBA_Object_duplicate((CORBA_Object) poa, ev);
   POA_Examples_ByteSeq_Storage__init((PortableServer_Servant) newservant,
                      ev);
   /* Before servant is going to be activated all
    * private attributes must be initialized.  */

   /* ------ init private attributes here ------ */
   /* ------ ---------- end ------------- ------ */

   objid = PortableServer_POA_activate_object(poa, newservant, ev);
   CORBA_free(objid);
   retval = PortableServer_POA_servant_to_reference(poa, newservant, ev);

   return retval;
}

static void
impl_Examples_ByteSeq_Storage__destroy(impl_POA_Examples_ByteSeq_Storage *
                       servant, CORBA_Environment * ev)
{
   CORBA_Object_release((CORBA_Object) servant->poa, ev);

   /* No further remote method calls are delegated to
    * servant and you may free your private attributes. */
   /* ------ free private attributes here ------ */
   /* ------ ---------- end ------------- ------ */

   POA_Examples_ByteSeq_Storage__fini((PortableServer_Servant) servant, ev);
}

Best regards, Frank





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