Textue release assert

opengl

#1

HI, I’m getting this assert in OpenGLTexture::release():

 // If the texture is deleted while the owner context is not active, it's
 // impossible to delete it, so this will be a leak until the context itself
 // is deleted.
  jassert (ownerContext == OpenGLContext::getCurrentContext());      (X) - assert fired

I’m calling the single texture release just like the OpenGLDemo_App. i.e.

 void openGLContextClosing() override
        {
            // When the context is about to close, you must use this callback to delete
            // any GPU resources while the context is still current.
            freeAllContextObjects();

        }
        void freeAllContextObjects()
        {
            shape     .reset();
            shader    .reset();
            attributes.reset();
            uniforms  .reset();
            texture   .release();
        }

Except mine gets to the texture release and assert happens!

I have about 4 opengl contexts over the plug-in, but this is only one with a texture.
*The texture binds OK and renders fine.

The textuer.loadImage function is called in the renderOpenGL function just after a
jassert(OpenGLHelpers::isContextActive());

I think it’s because I have a load of active contexts and it quits with the wrong one context active? I found this out by this never being true at openGLContextClosing()

 if (OpenGLHelpers::isContextActive())
{
		texture.release();
}