From: Antoine Labour Date: Fri, 25 May 2012 01:15:44 +0000 (-0700) Subject: mesa: Free uniforms correclty. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e2e9b4b10fcf3ba6358b9be54638f850523af82e;p=mesa.git mesa: Free uniforms correclty. This is an array of uniforms, not a single one. Reviewed-by: Ian Romanick NOTE: This is a candidate for the 8.0 branch. --- diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index 7eb6f0bdab0..d5ebf54af8e 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;