[omniORB] nil object destruction
Duncan Grisby
duncan@grisby.org
Wed Feb 5 18:22:01 2003
On Wednesday 5 February, "Renzo Tomaselli" wrote:
> Things are a bit harder, since the crash occurs at runtime exit. That's
> because _omniFinalCleanup is a singleton class (one static instance), which
> destructor gets rid of all accumulated nils.
True.
> Whether the orb has been destroyed or not doesn't matter.
False. This is the code:
_omniFinalCleanup::~_omniFinalCleanup()
{
if (--count() != 0)
return;
if (!omniOrbORB::all_destroyed()) {
omniORB::logs(15, "ORB not destroyed; no final clean-up.");
return;
}
omniORB::logs(15, "Final clean-up");
int nils = 0;
omnivector<CORBA::Object_ptr>::iterator i = nilObjectList()->begin();
for (; i != nilObjectList()->end(); i++, nils++)
delete *i;
...
> Btw, it's a bit unclear to me whether exiting without such a destroy raises
> unexpected failures or it can be considered a normal exit. I will check it.
It shouldn't cause any problems to exit without calling destroy(). The
OS will clear up any resources the ORB is using.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan@grisby.org --
-- http://www.grisby.org --