[omniORB] ServantBase or RefCountServantBase possible bug in omniidl?

David Scott djs@uk.research.att.com
Fri, 14 Jul 2000 14:11:39 +0100 (BST)


Hi,

On Fri, 14 Jul 2000, Alex Shabarshoff wrote:

> While  experimenting with omniORB3 pre3, i have found what all classes
> generated    by    omniidl   derives   from   ServantBase   not   from
> RefCountServantBase.  So  all servants does not deleted when reference
> count reaches 0 (actualy it does not reach 0).
> 
According to the C++ language mapping (p1-137) the generated skeleton
classes should be directly or indirectly derived from 
PortableServer::ServantBase.

When you implement your servant class you can enable reference counting by
multiply inheriting from the RefCountServantBase mixin class.

For an example, have a look in src/examples/echo/eg1.cc:

class Echo_i : public POA_Echo,
               public PortableServer::RefCountServantBase
{
...
...
    // We allocate the object on the heap.  Since this is a reference
    // counted object, it will be deleted by the POA when it is no
    // longer needed.
    Echo_i* myecho = new Echo_i();

HTH,

David

-- 
  Dave Scott, Research Engineer, AT&T Laboratories Cambridge UK