# HG changeset patch # User reimar # Date 1096839751 0 # Node ID 02c0d43715732e607339c170a946cfdb30cc1d16 # Parent fef1923f6d0c5066e4c0d84c7a9183100dbb990c fixed memleak, especially for fixed-vo. Based on a patch by beastd (eclipse7 (at) gmx (dot) net). diff -r fef1923f6d0c -r 02c0d4371573 libvo/vo_gl2.c --- a/libvo/vo_gl2.c Sun Oct 03 19:51:33 2004 +0000 +++ b/libvo/vo_gl2.c Sun Oct 03 21:42:31 2004 +0000 @@ -88,7 +88,7 @@ static uint32_t texture_height; static int texnumx, texnumy, raw_line_len; static GLfloat texpercx, texpercy; -static struct TexSquare * texgrid; +static struct TexSquare * texgrid = NULL; static GLint gl_internal_format; static char * gl_internal_format_s; static int rgb_sz, r_sz, g_sz, b_sz, a_sz; @@ -212,6 +212,8 @@ if (texpercy > 1.0) texpercy = 1.0; + if (texgrid) + free(texgrid); texgrid = (struct TexSquare *) calloc (texnumx * texnumy, sizeof (struct TexSquare)); @@ -1176,6 +1178,10 @@ uninit(void) { if ( !vo_config_count ) return; + if (texgrid) { + free(texgrid); + texgrid = NULL; + } #ifdef GL_WIN32 vo_w32_uninit(); #else