diff options
Diffstat (limited to 'src/mesa/shader/program.c')
-rw-r--r-- | src/mesa/shader/program.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 0ccc741dd0c..e7211981366 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -40,6 +40,7 @@ #include "nvfragprog.h" #include "nvvertparse.h" #include "nvvertprog.h" +#include "atifragshader.h" /**********************************************************************/ @@ -324,8 +325,13 @@ _mesa_delete_program(GLcontext *ctx, struct program *prog) } else if (prog->Target == GL_FRAGMENT_SHADER_ATI) { struct ati_fragment_shader *atifs = (struct ati_fragment_shader *)prog; - if (atifs->Instructions) - _mesa_free(atifs->Instructions); + GLuint i; + for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { + if (atifs->Instructions[i]) + _mesa_free(atifs->Instructions[i]); + if (atifs->SetupInst[i]) + _mesa_free(atifs->SetupInst[i]); + } } _mesa_free(prog); |