AW: [omniORB] String handling problem with VC7.1

Ecker Severin Severin.Ecker at arcs.ac.at
Fri Mar 23 08:55:47 GMT 2007


Hi all,

> > I suspect that you are using non-debug and debug versions of MS C
> > runtime library: one is used by the omniORB and the other is used by
> > your application.

I've checked the libs and to me they seem to be the correct ones
(meaning I'm using the debug libs for my debug code)

> I would say,the problem is, when you assign the constant pointer to
> var.id, var assumes ownership of the memory pointed to, and it will
> attempt to free it, when the variable releases ownership of it.
> CosNaming::Name behaves like _var types in that respect, and your
> runtime is quite right to complain about freeing string constants.

I doubt that because the weird thing is in
static inline void free(char* s) {
  if (s && s != empty_string) delete[] s;
}

s indeed does have the same value as empty_string according to the
debugger and using the exact same code outside of the lib in my
application it does work fine. It just fails when code runs through this
function in the corba lib ;/

cheers,
severin




More information about the omniORB-list mailing list