MathewWi / freetype-gl

Automatically exported from code.google.com/p/freetype-gl
Other
0 stars 0 forks source link

memory leak in vertex buffer #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. allocate a vertex buffer with vertex_buffer_t *vertex_buffer_new( const char 
*format ) 
2. deallocate with void vertex_buffer_delete( vertex_buffer_t *self )
3. vertex_attributes are not freed

fix:
add the following lines to vertex_buffer_delete:

    for( int i=0; i<MAX_VERTEX_ATTRIBUTE; ++i )
    {
        if (self->attributes[i] != 0)
            free(self->attributes[i]);
    }

Original issue reported on code.google.com by jo...@piringer.net on 25 Jun 2012 at 12:14

GoogleCodeExporter commented 9 years ago
Thanks for the report.
Did you check out the last version (because I added some specific code for this 
bug):

for( int i=0; i<MAX_VERTEX_ATTRIBUTE; ++i )
    {
        if (self->attributes[i] != 0)
            free(self->attributes[i]);
    }

Original comment by Nicolas.Rougier@gmail.com on 25 Jun 2012 at 12:56

GoogleCodeExporter commented 9 years ago

Original comment by Nicolas.Rougier@gmail.com on 19 Jul 2012 at 8:36