[omniORB] Release and nil references

Duncan Grisby dgrisby@uk.research.att.com
Fri, 11 Jan 2002 10:39:34 +0000


On Thursday 10 January, "David Bellette" wrote:

> Excuse me for the newbie question but should CORBA::release() called
> on a _ptr or _var object set the object variable to nil?

No, release() just decrements a reference count. It never sets
anything to nil.

> Am I doing something wrong or should I being doing the following so
> is_nil() functions correctly?
> 
> CORBA::release(lEcho);
> lEcho = Echo::_nil();

If you want your object reference to be nil, that's the way to do it.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --