Discussion:
[omniORB] question on : is_nil()
smitha smi
2012-10-26 03:55:06 UTC
Permalink
Hello,

I have a code sequence as below

(1)

getObjectRef<dbServer, dbServer_var>(

iv_dbServRef,

FWDB_SERVER_OBJ);

=====> *iv_dbServRef *holds the object reference.

(2)

CORBA::ORB_var orb = CORBA::ORB_init(l_argc,l_argv);

orb->shutdown(true);

orb->destroy();

(3)

is *iv_dbServRef *still holds the reference*?
*

i tried using *CORBA::is_nil( iv_dbServRef )

*this call returns* false.

My question is , is it not suppose to return true?

Appreciate your quick response.

Thanks,

Smitha
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20121026/feadb1dd/attachment.html>
Duncan Grisby
2012-10-29 10:52:53 UTC
Permalink
Post by smitha smi
I have a code sequence as below
(1)
getObjectRef<dbServer, dbServer_var>(
iv_dbServRef,
FWDB_SERVER_OBJ);
You haven't told us what this function is doing, so I'll have to
guess... Presumably at this stage it has returned a valid object
reference.

[...]
Post by smitha smi
CORBA::ORB_var orb = CORBA::ORB_init(l_argc,l_argv);
orb->shutdown(true);
orb->destroy();
[...]
Post by smitha smi
is iv_dbServRef still holds the reference?
Yes.
Post by smitha smi
i tried using CORBA::is_nil( iv_dbServRef )
this call returns false.
That is correct.
Post by smitha smi
My question is , is it not suppose to return true?
Why would it? Shutting down the ORB doesn't magically turn all your
object references into nil. If you try to invoke an operation on the
object reference, you'll get a CORBA::BAD_INV_ORDER exception telling
you that you can't use it once the ORB is shut down.

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