[omniORB] Pliiiz help me with my callback-problem

bjorn rohde jensen shamus@tdcadsl.dk
Fri, 05 Apr 2002 23:06:06 +0200


Hi Charlotte,

 I am glad to hear, the problem has been solved and in such short time.
As
Kendall says, there are very specific and not always entirely obvious
rules
regarding the memory management in the C++ CORBA mapping. It is my
understanding, that the rules were made this way due to performance
considerations more than anything. Maybe it is a little ugly at times,
but it is really fast:)

> >   return (char*) "getStatus";

 This little bit of code has a fairly good chance of trashing the heap,
since the orb assumes, the string, it is being handed as return value,
has
been allocated by calling CORBA::string_alloc, and it will eventually
try
to free it by conceptually calling CORBA::string_free. I had to learn
this
the hard way too, it was not pretty, but i learnt the lesson well:)


Yours sincerely,

Bjorn