[omniORB] memory leaking, about LocalObject's _var type

Wernke zur Borg wernke.zur.borg at vega.de
Mon Aug 21 15:49:51 BST 2006


> From: omniorb-list-bounces at omniorb-support.com 
> [mailto:omniorb-list-bounces at omniorb-support.com] On Behalf Of ?? ??
> Sent: 19 August 2006 06:20
> To: omniorb-list at omniorb-support.com
> Subject: [omniORB] memory leaking, about LocalObject's _var type
> 
> Hi:
>   I'm using OMNIORB_4_1_0_BETA_2
>   I build instance( of local interface ) repeatedly and 
> assign it to same 
> _var type variable. It seems that the memory allocated last 
> time was not 
> released.


You should derive your servants from RefCountServantBase and use
_remove_ref() to dispose of the servant. Note that the constructor
already increments the ref count, therefore you have to explicitly call
_remove_ref() when you are done with the object. It is not enough to use
the servant_var assignment operator. It seems strange anyway to use an
object reference variable to hold an instance of a servant. Normally you
would use a servant pointer for it I believe.

Regards, Wernke



More information about the omniORB-list mailing list