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:
@@ -390,10 +390,12 @@ delete_shader_program(struct gl_context *ctx, GLuint name)
|
|||||||
if (!shProg)
|
if (!shProg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
shProg->DeletePending = GL_TRUE;
|
if (!shProg->DeletePending) {
|
||||||
|
shProg->DeletePending = GL_TRUE;
|
||||||
|
|
||||||
/* effectively, decr shProg's refcount */
|
/* effectively, decr shProg's refcount */
|
||||||
_mesa_reference_shader_program(ctx, &shProg, NULL);
|
_mesa_reference_shader_program(ctx, &shProg, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user