[omniORB] CORBA::is_nil problem

Attila Pletyak attila.pletyak@anemo.com
Fri, 25 May 2001 10:42:04 +0200


Try the following instead of NULL :
Echo_var echoref1 = echo::_nil();

Altough the C++ mapping uses pointers, the concept of pointers is not in 
the CORBA specification. This _nil function is guaranteed to give you an 
empty reference.

Sincerely,

Attila Pletyak

GAO,YAN (HP-Singapore,ex3) wrote:

>Hi, 
>
>I try the following code( eg2_clt.cc)
>
>Echo_var echoref1 = NULL; 
>
>   
>    if( CORBA::is_nil(echoref1) ) {
>      cerr << "Can't narrow reference to type Echo (or it was nil)." <<
>endl;
>      return 1;
>    }
>
>
>I will get core dump. It seems that CORBA::is_nil can not handle the point
>of NULL.
>
>My machine is HP-HU11 and using aCC3.30.
>
>Any advice are greatly appreciated,
>
>Best Regards,
>
>GY
>
>