[omniORB] basic parameter passing question

Anthony Shipman A.Shipman at vorticeresearchgroup.com
Thu Dec 1 13:16:00 GMT 2005


On Thursday 01 December 2005 03:18, you wrote:
>
> In the way this following code works:
>
>     isdn::BChannelControlClient_var retval = bchan->getControl();
>     return retval._retn();
>
> The _var makes a copy of the ref (if required) and when it is destructed
> (goes out of scope), it removes that copy.
>
> The problem with your first case is that you're making TWO copies of the
> ref and the server side stub only takes ownership of one of the copies.
>

As I understand it, in the first case the _var is cast to a _ptr and then 
passed to duplicate(). So there is only one copy of the ref being made.

-- 
Anthony Shipman                     | Mamas don't let your babies
A.Shipman at vorticeresearchgroup.com  | grow up to be outsourced.




More information about the omniORB-list mailing list