Commit d950a778 authored by Eric Anholt's avatar Eric Anholt
Browse files

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: default avatarChad Versace <chad@chad-versace.us>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
parent 7457da5e
......@@ -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);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment