Re: memory leak ?



Hi Michael,

Thanks again for the explanation, I am starting to understand CORBA by
now. I was away at an important meeting (MIPTEC, Basel, Switzerland)
last week in which we demonstrated our new software with CORBA and
everything went fine, thanks yo you all for helping me out in the
previous weeks ! Free software support is great and it works !

I am curious if other people have also used CORBA for automation ? We
now implement every driver for a device with its own CORBA-server and
interconnect them all, everything runs stable. One of the biggest
adavantages is that a problem in the client did not bring down the
server and normal operation continued after reconnecting another client
to the server.

Best regards,

Peter Van Osta

============================================
Michael Meeks wrote:
> 
> Hi Peter,
> 
> On Tue, 2003-05-06 at 14:07, Peter Van Osta wrote:
> > I thought that sequentialy freeing first the embedded octet sequence and
> > then the structure itself would do the job ? I am now testing the
> > behaviour of the sytem, so not everything has been completed, but the
> > transfer of image data should work ?
> 
>         Nope - CORBA_free does a deep free that is informed (magically) by the
> types it knows are embedded in the return value. This is done using a
> smart allocation tracker;
> 
>         Thus you just need to free the return value and it'll all go away
> nicely :-)
> 
> >       if( img->data._buffer )
> >               CORBA_free( img->data._buffer );
> >       free( img );
> 
>         Bin those lines; and do:
> 
>         CORBA_free (img); also our CORBA_free silently tolerates NULL, so you
> can just do: CORBA_free (message) for a cleaner code-path :-)
> 
>         You are however missing a vital: if (ev._major != CORBA_NO_EXCEPTION)
> /* exit cleanly */ - using the results of a CORBA method without
> checking for exceptions first is dangerous, undefined behavior.
> 
>         HTH,
> 
>                 Michael.
> 
> --
>  mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot



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