[omniORB] strange asymmetric behavior

Renzo Tomaselli renzo.tomaselli at tecnotp.it
Mon Jul 21 13:58:21 BST 2003


Hi all,
    I noticed a strange behavior in OmniORB 4.01 when an obj ref. is taken
within the context of servant code.
Assume a servant Console obj (which inherits from RefCountServantBase as
usual)
is created and activated. Then next line of code:

Console_var cv = console->_this();

causes the side effect of increasing the ref. counter pd_refCount of target
servant, depending on the context where this is performed. This is decided
in PortableServer::ServantBase::_do_this() - in portableserver.cc - if
current is not the servant itself and there are no activations (or more than
one).
Then omniOrbPOA::servant__this() is called, which in turn performs the
_add_ref().

The bad news are that one would expect this side effect to be reversed when
obj ref. goes out of scope, thus decreasing the servant ref. counter. But
this never occurs (no _remove_ref()), and this servant will never be
destroyed after deactivation since application code doesn't now anything
about this counter being increased.
Any comment ? Thanks,

Renzo Tomaselli







More information about the omniORB-list mailing list