[omniORB] Problems with method returning a complex structure

Duncan Grisby dgrisby@uk.research.att.com
Fri, 30 Jun 2000 16:29:17 +0100


On Thursday 29 June, Andy Weber wrote:

> My original attempt was like this:
> 
> updates * recordData_i::refresh()
> {
>         updates         *Result;        // has to be new'd!!
> 
>         Result = new updates();
>         ...
>         return Result;
> }
>
> which I would have thought the most obvious way to write it, but it also
> crashed with a similar heap error.

That is indeed the correct way to do what you are trying to do. The
heap allocation error sounds like the error you get when you mix debug
and non-debug code on Windows. Make sure that if you are compiling
code with debugging you use the debug DLLs; if you don't compile with
debugging, use the non-debug DLLs.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --