[omniORB] memory leaking, about LocalObject's _var type
Duncan Grisby
duncan at grisby.org
Sat Aug 19 15:39:40 BST 2006
On Saturday 19 August, =?gb2312?B?zrTWqiDUqsvY?= wrote:
> 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 need to implement your own reference counting functions. Don't ask
me why, but the C++ mapping says that the default reference counting
functions are empty. See section 1.35 of the C++ mapping specification,
version 1.1:
_add_ref
The _add_ref member function is called when the reference is
duplicated. A default implementation is provided that does nothing.
A derived implementation may use this operation to maintain a
reference count.
_remove_ref
The _remove_ref member function is called when the reference is
released. A default implementation is provided that does nothing. A
derived implementation may use this operation to maintain a
reference count, and delete the object when the count becomes zero.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list