[omniORB] Why does _this() increment ref count on servant for the first time it's called?

Alex Tingle alex.tingle at bronermetals.com
Tue Oct 31 16:58:04 GMT 2006

It's because _this() activates the servant in the default POA the first 
time it is called (but only if the servant hasn't already been 
activated, of course).

The extra reference is the one owned by the POA. When you deactivate 
the object (with deactivate_object()) the POA will eventually call 
_remove_ref(), and everything will balance out.


:: Let me solve your problems: http://www.firetree.net/consulting/
:: alex.tingle AT firetree.net  +44-7901-552763

On 31 Oct 2006, at 16:38, Tuyen Chau wrote:

> We are debugging the reference counting on our servants and ran into a 
> peculiar problem with _this() function.  Why does _this() increment 
> the reference count on the servant for the first time the function is 
> called, and then if we call _this() again on the same servant 
> subsequently, it does not increment the reference count again?  Is 
> this the correct behavior that we are seeing?
> Our servants derive from RefCountServantBase because we want them to 
> go away when no clients need them anymore.  We are very careful with 
> object reference counts and make sure that they are correct for the 
> number of clients.
> Thanks in advance for any help you can provide,
> Tuyen
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list

More information about the omniORB-list mailing list