My opengl application is based on classic Qml architecture :
- a QQuickFramebufferObject instance (my view)
- a QQuickFramebufferObject::renderer ( my renderer).
Remark : The OpenglContext is shared (Qt::ApplicationAttribute::AA_ShareOpenGLContexts)
This renderer is composed by several QOpenGLFunctions_3_3_Core instances.
One of them is working with a texture.
The texture is initiated inside the Renderer::render() method and also destroyed inside it.
When I tried to close my application, the view is deleted but not my renderer then the application does not close.
When I reduce my code as much as possible, It seems the issue happens because of :
tex=new QOpenGLTexture(image); ...
when I move to another QOPenGlTExture ctor :
tex=new QOpenGLTexture(QOpenGLTexture::Target2D); // line 1 tex->setMinificationFilter(QOpenGLTexture::Linear); // line 2 ....
Issue happens when line 2 is enabled .
If I change to raw opengl functions (Non DSA) like :
glGenTextures(1, &id); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img.width(), img.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits()); ...
It works well .
Remark : the display is always correct : texture is correctly used but the issue is only related to a fail of the Renderer destruction .
Thank you All