[omniORB] [omniORB 2.8.0] problem with delete of the output sequence
of structs
Stefan Seefeld
seefelds@MAGELLAN.UMontreal.CA
Mon, 21 Feb 2000 22:48:27 -0500
Gennady Agranov wrote:
>
> Hi!
>
> IDL piece:
>
> >>> struct model_info {
> >>> int model_type;
> >>> int server;
> >>> string name;
> >>> string description;
> >>> boolean not_saved;
> >>> };
>
> >>> typedef sequence <model_info> models_info;
>
> >>> models_info get_models_info(
> >>> in session_id session) raises (star_exception);
>
> After I successfully called get_models_info and used
> the return value I presumed that I have to call delete
> on the returned model_info_ptr. But MSVC6 runtime is not
> happy (see the end of this mail). I understand that I
> could corrupt the memory somewhere else. My question is
> should I or should not free the returned pointer ?
You should. To hide these nasty details you may assign the
return value directly to a var type which then takes care of
the clean up. This then looks like
models_info_var models = ariadne->get_models_info(session);
Regards, Stefan
_______________________________________________________
Stefan Seefeld
Departement de Physique
Universite de Montreal
email: seefelds@magellan.umontreal.ca
_______________________________________________________
...ich hab' noch einen Koffer in Berlin...