From 58d080b025c52710324eb719d6e74900cb4f64bf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 Aug 2006 19:46:31 +0000 Subject: [PATCH] Free vertex program TnlData, if any. Fixes a mem leak. --- src/mesa/shader/program.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 826fb739c0b..590f357b636 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -300,6 +300,13 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_free_parameter_list(prog->Parameters); } + /* XXX this is a little ugly */ + if (prog->Target == GL_VERTEX_PROGRAM_ARB) { + struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; + if (vprog->TnlData) + _mesa_free(vprog->TnlData); + } + _mesa_free(prog); } -- 2.30.2