mirror of
https://github.com/mpv-player/mpv
synced 2025-04-09 11:11:52 +00:00
fixed memleak, especially for fixed-vo.
Based on a patch by beastd (eclipse7 (at) gmx (dot) net). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13541 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8b3593e9bf
commit
e3e81503aa
@ -88,7 +88,7 @@ static uint32_t texture_width;
|
|||||||
static uint32_t texture_height;
|
static uint32_t texture_height;
|
||||||
static int texnumx, texnumy, raw_line_len;
|
static int texnumx, texnumy, raw_line_len;
|
||||||
static GLfloat texpercx, texpercy;
|
static GLfloat texpercx, texpercy;
|
||||||
static struct TexSquare * texgrid;
|
static struct TexSquare * texgrid = NULL;
|
||||||
static GLint gl_internal_format;
|
static GLint gl_internal_format;
|
||||||
static char * gl_internal_format_s;
|
static char * gl_internal_format_s;
|
||||||
static int rgb_sz, r_sz, g_sz, b_sz, a_sz;
|
static int rgb_sz, r_sz, g_sz, b_sz, a_sz;
|
||||||
@ -212,6 +212,8 @@ static int initTextures()
|
|||||||
if (texpercy > 1.0)
|
if (texpercy > 1.0)
|
||||||
texpercy = 1.0;
|
texpercy = 1.0;
|
||||||
|
|
||||||
|
if (texgrid)
|
||||||
|
free(texgrid);
|
||||||
texgrid = (struct TexSquare *)
|
texgrid = (struct TexSquare *)
|
||||||
calloc (texnumx * texnumy, sizeof (struct TexSquare));
|
calloc (texnumx * texnumy, sizeof (struct TexSquare));
|
||||||
|
|
||||||
@ -1176,6 +1178,10 @@ static void
|
|||||||
uninit(void)
|
uninit(void)
|
||||||
{
|
{
|
||||||
if ( !vo_config_count ) return;
|
if ( !vo_config_count ) return;
|
||||||
|
if (texgrid) {
|
||||||
|
free(texgrid);
|
||||||
|
texgrid = NULL;
|
||||||
|
}
|
||||||
#ifdef GL_WIN32
|
#ifdef GL_WIN32
|
||||||
vo_w32_uninit();
|
vo_w32_uninit();
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user