aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-10-01 20:21:47 -0400
committerIlia Mirkin <[email protected]>2015-10-02 14:14:27 -0400
commit19598aaa5d0ea318ebd4a7e731bcaacaa4f3fe7c (patch)
treedcbcac98f80180d6c7ac499af052d5d8bc9544a1 /src/glsl
parentda2fdf950fe754f9d38b3c2b8e73582ac92c4477 (diff)
glsl: avoid leaking hiddenUniforms map when there are no uniforms
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/link_uniforms.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
index 47d49c84e65..740b0a46aee 100644
--- a/src/glsl/link_uniforms.cpp
+++ b/src/glsl/link_uniforms.cpp
@@ -1131,15 +1131,15 @@ link_assign_uniform_locations(struct gl_shader_program *prog,
const unsigned num_data_slots = uniform_size.num_values;
const unsigned hidden_uniforms = uniform_size.num_hidden_uniforms;
+ /* assign hidden uniforms a slot id */
+ hiddenUniforms->iterate(assign_hidden_uniform_slot_id, &uniform_size);
+ delete hiddenUniforms;
+
/* On the outside chance that there were no uniforms, bail out.
*/
if (num_uniforms == 0)
return;
- /* assign hidden uniforms a slot id */
- hiddenUniforms->iterate(assign_hidden_uniform_slot_id, &uniform_size);
- delete hiddenUniforms;
-
struct gl_uniform_storage *uniforms =
rzalloc_array(prog, struct gl_uniform_storage, num_uniforms);
union gl_constant_value *data =