summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/program.c')
-rw-r--r--src/mesa/shader/program.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index ca0421181ce..307736f79ca 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -278,8 +278,14 @@ _mesa_delete_program(GLcontext *ctx, struct program *prog)
else if (prog->Target == GL_FRAGMENT_PROGRAM_NV ||
prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
struct fragment_program *fprog = (struct fragment_program *) prog;
- if (fprog->Instructions)
+ if (fprog->Instructions) {
+ GLuint i;
+ for (i = 0; i < fprog->Base.NumInstructions; i++) {
+ if (fprog->Instructions[i].Data)
+ _mesa_free(fprog->Instructions[i].Data);
+ }
_mesa_free(fprog->Instructions);
+ }
if (fprog->Parameters)
_mesa_free_parameter_list(fprog->Parameters);
}