Re: ORBit support compound type return value ????



On Thu, 7 Sep 2000, [euc-kr] ÀåÁ¾Çö wrote:

> ORBit can't support variable compound type return.

It should work fine.

> static Four_fourst*
> impl_Four_mix(impl_POA_Four * servant, Four_fourst *member, CORBA_Environment *
> ev)
> {
>     Four_fourst retval;
> 
>     printf("impl_Four_MIX : name=%s\n", member->name);
>     retval.name = "KHS";
>     return &retval;
> }
> 
> What's wrong ?

Your code is broken - you need to return "ownership" of the return value's
associated memory, which in this case means allocating a Four_fourst
structure and returning that. Instead you are returning the address of a
value on the stack, which will no longer be valid once the function has
returned.

-- Elliot
DEAR IRS, Please cancel my subscription.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]