OSDN Git Service

ir_to_mesa: Stop leaking the ir_instruction * annotation of our compile.
authorEric Anholt <eric@anholt.net>
Wed, 18 Aug 2010 20:48:32 +0000 (13:48 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 18 Aug 2010 21:16:07 +0000 (14:16 -0700)
src/mesa/program/ir_to_mesa.cpp

index 394370d..5299d77 100644 (file)
@@ -2412,7 +2412,6 @@ struct gl_program *
 get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program,
                 struct gl_shader *shader)
 {
-   void *mem_ctx = shader_program;
    ir_to_mesa_visitor v;
    struct prog_instruction *mesa_instructions, *mesa_inst;
    ir_instruction **mesa_instruction_annotation;
@@ -2490,7 +2489,7 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program,
    mesa_instructions =
       (struct prog_instruction *)calloc(num_instructions,
                                        sizeof(*mesa_instructions));
-   mesa_instruction_annotation = talloc_array(mem_ctx, ir_instruction *,
+   mesa_instruction_annotation = talloc_array(v.mem_ctx, ir_instruction *,
                                              num_instructions);
 
    mesa_inst = mesa_instructions;