[xsde-users] memory management of variable-length elements?

Ivan Le Lann ivan.lelann at free.fr
Fri Jun 24 04:13:52 EDT 2011


----- "Sebastian Friebe" <Sebastian.Friebe at xfab.com> a écrit :

> Hi all,
> 
> I got a lot of variable length elements in my schema. 
> Code generation works fine with following flags:
> cxx-hybrid --generate-parser --generate-serializer --no-long-long
> --generate-aggregate --generate-clone
> 
> Is there any flag to generate delete functionality into the
> destructors of such elements? Is there a better way to safely free the
> memory allocated for the pointers, without using custom allocators?
> 

There is no such flag because this is already what the generated code does.
Just check generated destructors to see that they delete child elements.

> The hybrid manual just says 'the object model expects you to allocate
> such an object with operator new and will <eventually> delete it with
> operator delete.
> 
> What means eventually in this case?
> 

When parent is deleted.

Ivan



More information about the xsde-users mailing list