Skip to content
  • Kenneth Graunke's avatar
    mesa: Prevent repeated glDeleteShader() from blowing away our refcounts. · c3bc4101
    Kenneth Graunke authored
    Calling glDeleteShader() should mark shaders as pending for deletion,
    but shouldn't decrement the refcount every time.  Otherwise, repeated
    glDeleteShader() is not safe.
    
    This is particularly bad since glDeleteProgram() frees shaders: if you
    first call glDeleteShader() on the shaders attached to the program (thus
    decrementing the refcount), then called glDeleteProgram(), it would try
    to free them again (decrementing the refcount another time), causing
    a refcount > 0 assertion to fail.
    
    Similar to commit d950a778
    
    .
    
    NOTE: This is a candidate for the 8.0 branch.
    
    Signed-off-by: default avatarKenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
    c3bc4101