• Jocelyn Turcotte's avatar
    Do not parent the shader program to the QOpenGLContext · ab79e832
    Jocelyn Turcotte authored
    
    When the last QOpenGLContext in a share group is destroyed, all the
    remaining alive QOpenGL* objects have their resource invalidated.
    
    This happens under QOpenGLContext::destroy, but before any QObject
    children of the QOpenGLContext is destroyed by the QObject destructor.
    This is currently an issue with ANGLE that could be fixed in its own
    code, but that is still better for us to be covered against.
    
    This means that the OpenGL resource is assumed to be destroyed with
    the context by the driver, but this isn't always the same.
    
    Fix an instance of this in QOpenGLTextureGlyphCache by explicitly
    owning the blit QOpenGLShaderProgram instead of parenting it under
    the current GL context. The very same resource invalidation system
    will prevent anything bad to happen if the QOpenGLContext is
    destroyed before the QOpenGLTextureGlyphCache.
    
    Task-number: QTBUG-41588
    Change-Id: Ic3bc69b07bcbdcf7d699ea9139b2e34b04e642e5
    Reviewed-by: default avatarLaszlo Agocs <laszlo.agocs@digia.com>
    ab79e832