[Ace-users] [ciao-users] Memory Leak?
Sowayan, Abdullah (N-DUA)
abdullah.sowayan at lmco.com
Wed Oct 24 11:15:28 CDT 2007
CIAO VERSION: 0.6.1 (SVN HEAD Also)
If you look at the following header file:
CIAO/DAnCE/Deployment/NodeApp_CB_Impl.h
Class NodeApplication_Callback_Impl
{
/// Get the containing POA. This operation does *not* increase
/// the reference count of the POA.
virtual PortableServer::POA_ptr _default_POA (void);
};
Note that the documentation above say that the reference count is not
increased.
If you look at the cpp file, you'll find the following implementation:
PortableServer::POA_ptr
CIAO::NodeApplication_Callback_Impl::_default_POA (void)
{
return PortableServer::POA::_duplicate ( this->poa_.in ());
}
The implementation lies, and does increase the reference count. If the
user of this code does follow the comment and not decrease the reference
count, then we have a memory leak. If some places decrease while others
don't, if we modify the cpp implementation, we run into problems.
Thanks,
Abdul
More information about the Ace-users
mailing list