mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-16 04:38:30 +02:00
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 <chad@chad-versace.us> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
7457da5edd
commit
d950a778b7
1 changed files with 5 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue