Hi Johannes,

On 1/03/11 2:53 , Johannes Baeuerle wrote:
> The problem only arises in a gles2 environment (#if 
> defined(OSG_GLES2_AVAILABLE)). At
> the beginning of the method a variable 'formats' (a GLint pointer) is 
> declared. In the
> case when a binary shader could be successfully loaded, the method is left 
> with a return
> statement. In that case the variable 'formats' is not deleted anymore.
> In the case when no binary format is available (numFormats==0) the whole 
> block is
> never reached .If the binary shader could not be loaded, the memory is 
> deleted as expected in
> the next line after the for loop that iterates over the available formats.
> 
> I have added a call into the described control path to delete the memory 
> behind the
> 'formats' pointer, that should resolve the memory leak.

Can I suggest to use std::vector<int> instead?  Or maybe auto_ptr?
We shouldn't really have to do manual memory management anymore...

Just my $.02
Cheers,
/ulrich
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to