Hi Robert,

That's because 'buffer' is returned as the image data if the image is
not an animated one. We should not delete it unless the GifStream
object is allocated and returned. The GIF reader is a little old so I
myself can't recall the reason why we use such awkward structure here.

Cheers,

Wang Rui


2010/11/9 Robert Osfield <[email protected]>:
> Hi Wang Rui,
>
> I've just reviewed your change and am a bit perplexed why the if
> statement. Your change was to add:
>
>    // Delete the last allocated buffer to avoid memory leaks
>    if ( *obj && obj )
>        delete [] buffer;
>
>
> Why wouldn't :
>
>  delete [] buffer;
>
> Be sufficient?
>
> Robert.
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to