[omniORB] [omniORB 2.8.0] problem with delete of the output sequence of structs

Poilpret Jean Francois jfpoilpret@hn.vnn.vn
Tue, 22 Feb 2000 11:57:36 +0700


Hi Gena,

Yes you should dispose of the returned sequence.
Regarding your problem, did you check that, on the server side, you =
always fill the two string members (name and description), at least with =
an empty string ("").
According to the latest specs, you should not have to do this, but =
depending on the omniORB 2.8 release you use, you may encounter problems =
(the automatic filling of strings in structures was introduced only =
recently I think).
Moreover, check that you fill every element of the sequence =
(server-side), I mean, if you set the length of the sequence to 10, for =
instance, then you should fill every element from 0 to 9 (if you forget =
one element, you could also have problems).

Hope this helps,

    Jean-Fran=E7ois

-----Original Message-----
From: Gennady Agranov <agranov@synquiry.com>
To: omniorb-list@uk.research.att.com <omniorb-list@uk.research.att.com>
Date: mardi 22 f=E9vrier 2000 10:14
Subject: [omniORB] [omniORB 2.8.0] problem with delete of the output =
sequence of structs


>
>Hi!
>
>IDL piece:
>
>>>>    struct model_info {
>>>>      int model_type;
>>>>      int server;=20
>>>>      string        name;=20
>>>>      string        description;
>>>>      boolean       not_saved; =20
>>>>    };
>
>>>>    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=20
>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=20
>could corrupt the memory somewhere else. My question is=20
>should I or should not free the returned pointer ?
>
>Thanks,
> Gena
>
>
>NTDLL! 77f7629c()
>NTDLL! 77f8322e()
>KERNEL32! 77f12e09()
>_CrtIsValidHeapPointer(const void * 0x00a07580) line 1606
>_free_dbg_lk(void * 0x00a07580, int 1) line 1011 + 9 bytes
>_free_dbg(void * 0x00a07580, int 1) line 970 + 13 bytes
>operator delete(void * 0x00a07580) line 49 + 16 bytes
>_CORBA_String_member::~_CORBA_String_member() line 180 + 37 bytes
>ariadne::ir::model_info::~model_info() + 68 bytes
>ARIADNE! `eh vector destructor iterator'(void *,unsigned int,int,void =
(*)(void *)) + 94 bytes
>ariadne::ir::model_info::`vector deleting destructor'(unsigned int 3) + =
62 bytes
>_CORBA_Sequence<ariadne::ir::model_info>::freebuf(ariadne::ir::model_inf=
o * 0x00f12f34) line 137 + 34 bytes
>_CORBA_Sequence<ariadne::ir::model_info>::~_CORBA_Sequence<ariadne::ir::=
model_info>() line 179 + 33 bytes
>_CORBA_Unbounded_Sequence<ariadne::ir::model_info>::~_CORBA_Unbounded_Se=
quence<ariadne::ir::model_info>() line 308 + 37 bytes
>ariadne::ir::models_info::~models_info() + 37 bytes
>ariadne::ir::models_info::`scalar deleting destructor'(unsigned int 1) =
+ 37 bytes
>AriadneStar::get_models_info(AriadneStar * const 0x00f11284, unsigned =
long 29, __MIDL___MIDL_itf_ariadne_0000_0010 * 0x0012f854) line 262 + 28 =
bytes
>
>
>