[omniORB] sequence mapping in C++

Zsolt Rizsanyi rizsanyi at myrealbox.com
Tue Mar 2 11:27:03 GMT 2004


On Tuesday 02 March 2004 09.48, Thierry DESCOMBES wrote:
> I'd like the sequence to be initialized by a function... but the
> following code causes memory leak:

>    void main()
>    {
>      ...
>      SeqAdcEventData *seq=readData();

What you probably want here is:
      SeqAdcEventData_var seq=readData();

or some other way to release seq.
>      ...
>    }

If that does not help, then please elaborate on how do you know there is 
memory leak, and what is exactly happening.

> What is the correct way to do that ? In the book "advanced CORBA
> Programming with C++", I can read "Never pass a sequence to a function
> for modification if the release flag is false". So in my case, how must
> I do to have the flag set to true? Pleeeaasse Hellp !!!!

No. The flag is by default true. And you doesn't even use that constructor.
This has nothing to do with that paragraph.

Regards
Zsolt




More information about the omniORB-list mailing list