Re: CORBA_free problem



Hi Peter,

On Wed, 2003-07-16 at 14:30, Peter Van Osta wrote:
> The structure contains some strings, which all could be freed with
> CORBA_free, but when I want to free the structure itself the application
> crashes.

	A CORBA_free does a deep free - ie. if you have:

struct Foo { string a; string b; };

and you get returned a Foo *; then if you do:

CORBA_free (foo->a); // WRONG
CORBA_free (foo->b); // WRONG
CORBA_free (foo);    // WRONG

	The free (foo) will try to do a deep recursive free of the structure's
contents, and die horribly re-freeing the strings.

	Instead just CORBA_free (foo). In fact the 0xdeadbeef is quite specific
though to ORBit _1_ - which is highly non-recommended; please use ORBit2
instead, it's much better :-)

	Regards,

		Michael.

-- 
 michael@ximian.com  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]