[omniORB] ORB::destroy() mandatory

Duncan Grisby duncan at grisby.org
Wed Feb 11 16:48:55 GMT 2004


On Tuesday 27 January, "Frederic Prin" wrote:

> I store my ORB in a CORBA::ORB_var mOrb member variable.
> When exiting my app, after doing a shutdown(0), my programs either
> deadlock (windows) or core dump (Solaris5.8, HPUX11) or abort
> (LinuxRH7.1).
> 
> If I call mOrb->destroy() it works! My program exit with normal code.
> 
> My pb is that I can't always call mOrb->destroy(); 
> 
> My questions are:
> 1) Is it mandatory to call mOrb->destroy(); ?

No.

> 2) Where can I find doc on how and why call destroy ?

Call destroy if you want to free all resources used by the ORB. Since
you normally exit the process immediately after destroy, the OS does
that for you anyway.

> I though the ORB_var automatically calls destroy when the reference
> count == 0.

No. Like any other object reference, the ORB_var going out of scope
just releases the ORB reference. It does nothing to destroy the ORB
object itself.

Anyway, whether you destroy the ORB or not, you shouldn't get the
failures you are seeing. Try using a debugger to see where it's
blowing up.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list