mesa: Free linked shaders when deleting the shader program.
authorEric Anholt <eric@anholt.net>
Wed, 18 Aug 2010 21:12:52 +0000 (14:12 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 18 Aug 2010 21:16:07 +0000 (14:16 -0700)
src/mesa/main/shaderobj.c

index 863d50fbe559f1e20d00961feea966c723dea5db..1755e8a33c7ff540320382e6547607ca815b2c48 100644 (file)
@@ -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;
 }