summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-08-18 14:12:52 -0700
committerEric Anholt <eric@anholt.net>2010-08-18 14:16:07 -0700
commit56a0690a81cd6a0e7db4c041430ca38e5063e145 (patch)
tree9d9fe380b70ae2899032450f43388a17fba058ae
parent5d0f430e8ed01db29d11d22e4b6c3760d8c39f8f (diff)
mesa: Free linked shaders when deleting the shader program.
-rw-r--r--src/mesa/main/shaderobj.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 863d50fbe5..1755e8a33c 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -314,6 +314,12 @@ _mesa_free_shader_program_data(GLcontext *ctx,
free(shProg->TransformFeedback.VaryingNames);
shProg->TransformFeedback.VaryingNames = NULL;
shProg->TransformFeedback.NumVarying = 0;
+
+
+ for (i = 0; i < shProg->_NumLinkedShaders; i++) {
+ ctx->Driver.DeleteShader(ctx, shProg->_LinkedShaders[i]);
+ }
+ shProg->_NumLinkedShaders = 0;
}