randi120 / freetype-gl

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

memory leak in texture-font.cpp #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
/*** problem ***/
texture_glyph_t *
texture_font_get_glyph( texture_font_t * self,
                        wchar_t charcode ){
...
static wchar_t *buffer = 0;
...
    if( !buffer)
    {
        buffer = (wchar_t *) calloc( 2, sizeof(wchar_t) );
    }
...
}

/*** fix ***/

//static wchar_t *buffer = 0;
wchar_t buffer[2] = {0,0};

//delete following lines:
//if( !buffer)
//{
//  buffer = (wchar_t *) calloc( 2, sizeof(wchar_t) );
//}

Original issue reported on code.google.com by bso...@gmail.com on 18 Jul 2012 at 10:08

GoogleCodeExporter commented 8 years ago
Fixed ! And thanks for all these bugs and fixes.

I added your pseudo in the README, just send me your name if you prefer.

Nicolas

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