Commit f60a57eb authored by Paul Lemire's avatar Paul Lemire
Browse files

Renderer: check context thread before destroying resources

Only try to cleanup the resources if we know we are called from the right

releaseGraphicsResources can be called from 2 places:
- Scene3DCleaner when using Scene3D (when closing the window)
- AspectThread when the RenderAspect gets unregistered

In configurations where the context lives in the main thread (Scene3D +
single threaded render loop / ANGLE), the RenderAspect gets unregistered
before the Scene3DCleaner has had time to call releaseGraphicsResources.

This means that we won't release the resources ourselved and that the
driver will have to do that for us.

This has been fixed properly in 5.14 with the AspectThread removal.

Task-number: QTBUG-60971
Change-Id: I49c1c2f74ad09e7162b988f87bac65863f8490d8
Reviewed-by: default avatarSean Harmer <>
parent 7628760f
......@@ -520,7 +520,8 @@ void Renderer::releaseGraphicsResources()
QOpenGLContext *context = m_submissionContext->openGLContext();
if (context->makeCurrent(offscreenSurface)) {
if (context->thread() == QThread::currentThread() && context->makeCurrent(offscreenSurface)) {
// Clean up the graphics context and any resources
const QVector<GLTexture*> activeTextures = m_nodesManager->glTextureManager()->activeResources();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment