mesa: Hang the compiled shader off the shader->ir, not the shader.

Otherwise, with repeated program recompile, we never free the results
of the previous compile.
This commit is contained in:
Eric Anholt
2010-08-18 11:36:09 -07:00
parent 0df61bdb66
commit 4a6a431684
+2 -1
View File
@@ -2662,6 +2662,7 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
_mesa_glsl_lexer_dtor(state);
}
talloc_free(shader->ir);
shader->ir = new(shader) exec_list;
if (!state->error && !state->translation_unit.is_empty())
_mesa_ast_to_hir(shader->ir, state);
@@ -2706,7 +2707,7 @@ _mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
}
/* Retain any live IR, but trash the rest. */
reparent_ir(shader->ir, shader);
reparent_ir(shader->ir, shader->ir);
talloc_free(state);