summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAntoine Labour <piman@chromium.org>2012-05-24 18:15:44 -0700
committerStéphane Marchesin <marcheu@chromium.org>2012-06-12 14:42:22 -0700
commite2e9b4b10fcf3ba6358b9be54638f850523af82e (patch)
tree9ae03397bcb0179158b84ec36b6b15812a9b472f /src
parent53feb8ecdc74502c940a749b9ce89e68625c69a5 (diff)
downloadexternal_mesa3d-e2e9b4b10fcf3ba6358b9be54638f850523af82e.zip
external_mesa3d-e2e9b4b10fcf3ba6358b9be54638f850523af82e.tar.gz
external_mesa3d-e2e9b4b10fcf3ba6358b9be54638f850523af82e.tar.bz2
mesa: Free uniforms correclty.
This is an array of uniforms, not a single one. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> NOTE: This is a candidate for the 8.0 branch.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/shaderobj.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 7eb6f0b..d5ebf54 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -278,7 +278,8 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
struct gl_shader_program *shProg)
{
if (shProg->UniformStorage) {
- _mesa_uniform_detach_all_driver_storage(shProg->UniformStorage);
+ for (unsigned i = 0; i < shProg->NumUserUniformStorage; ++i)
+ _mesa_uniform_detach_all_driver_storage(&shProg->UniformStorage[i]);
ralloc_free(shProg->UniformStorage);
shProg->NumUserUniformStorage = 0;
shProg->UniformStorage = NULL;