summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-10-04 15:36:15 -0700
committerEric Anholt <[email protected]>2011-10-10 11:38:52 -0700
commitd950a778b7b86526d3968deee232444af64d8cf1 (patch)
tree19ea125ef7f4657db2d6638eacf8721752c38674 /src/mesa/main/shaderapi.c
parent7457da5edd4a33c2581f10608ce5bcf0e254c5f9 (diff)
mesa: Prevent repeated glDeleteProgram() from blowing away our refcounts.
glDeleteProgram should only be able to remove the one refcount for the user's reference to the program from the hash table (even though that ref does live on in the hash table until the last other ref is removed). Fixes piglit ARB_shader_objects/delete-repeat. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c3aabe43f8b..6868dfab09e 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -390,10 +390,12 @@ delete_shader_program(struct gl_context *ctx, GLuint name)
if (!shProg)
return;
- shProg->DeletePending = GL_TRUE;
+ if (!shProg->DeletePending) {
+ shProg->DeletePending = GL_TRUE;
- /* effectively, decr shProg's refcount */
- _mesa_reference_shader_program(ctx, &shProg, NULL);
+ /* effectively, decr shProg's refcount */
+ _mesa_reference_shader_program(ctx, &shProg, NULL);
+ }
}