summaryrefslogtreecommitdiff
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.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index c2f4b146b6..ca0421181c 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -39,6 +39,7 @@
#include "nvfragparse.h"
#include "nvfragprog.h"
#include "nvvertparse.h"
+#include "nvvertprog.h"
/**********************************************************************/
@@ -263,8 +264,14 @@ _mesa_delete_program(GLcontext *ctx, struct program *prog)
if (prog->Target == GL_VERTEX_PROGRAM_NV ||
prog->Target == GL_VERTEX_STATE_PROGRAM_NV) {
struct vertex_program *vprog = (struct vertex_program *) prog;
- if (vprog->Instructions)
+ if (vprog->Instructions) {
+ GLuint i;
+ for (i = 0; i < vprog->Base.NumInstructions; i++) {
+ if (vprog->Instructions[i].Data)
+ _mesa_free(vprog->Instructions[i].Data);
+ }
_mesa_free(vprog->Instructions);
+ }
if (vprog->Parameters)
_mesa_free_parameter_list(vprog->Parameters);
}