Re: How to delete the "obj" object explicitly but not deleting orb?

Stan Lewis <[email protected]> Sat, 21 Oct 2006 09:23:50 -0400
Newsgroups gmane.comp.corba.orbacus
Organization IONA Technologies
Message-ID <[email protected]>
Hi Zhai,

On Saturday 21 October 2006 00:45, =E7=BF=9F=E6=98=8E=E7=8E=89 wrote:
> Stan Lewis,
>      In the attachment(modified from ./ob/demo/hello), we try to delete=
 the
> "obj" object explicitly but not deleting orb, which method can we invok=
e?
> thx.

You'd do this:

obj =3D CORBA::Object::_nil();
hello =3D Hello::_nil();

re-assignment of an _var type to _nil() causes the memory allocated for t=
he=20
proxy to be released.  One thing to note is that "hello" will be released=
=20
also when it goes out of scope, in your Client.cpp this would happen at l=
ine=20
63, since "hello" and "obj" are declared within the scope of the while()=20
loop.

Regards,

Stan
--=20
Stan Lewis                         =20
Team Orbacus - Your CORBA Source
E-Mail: [email protected]
WWW: http://www.orbacus.com
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html