[omniORB] Application shut down

Duncan Grisby dgrisby@uk.research.att.com
Mon, 15 Apr 2002 13:57:55 +0100


On Monday 15 April, David Hyde wrote:

> In general before I allow my applications to shut down I ensure that
> 
> POA::deactivate_object() and _remove_ref() have been called for all of my
> CORBA servers, then I call
> 
> ORB->shutdown(0);
> ORB->destroy();
> 
> and then the main() function terminates.
> 
> Can I guarantee that all of the destructors on all of my objects have
> completed before main() terminates, or is there some form of ayncronous
> operation that is liable to be cut short?

Yes, as long as you have got your servant reference counting right,
all the destructors will have run before destroy() finishes. In fact,
there's no need to call deactivate_object() on all the objects, since
ORB::destroy() does that. You shouldn't need to call _remove_ref()
after deactivate_object() -- if you do, that's a sign that you didn't
properly remove the ref when you activated the object.

Cheers,

Duncan.

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