Fix Scene3DRenderer crash during destruction.

Occurs when destroying a QQuickWindow containing a Qt3d scene.

Change-Id: Id951241a34bbac401b52f1f78586037859981e4b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
This commit is contained in:
Fredrik Orderud 2015-10-28 16:04:19 +01:00
parent 09ba2f8b9c
commit 68d32040f6
1 changed files with 4 additions and 2 deletions

View File

@ -229,7 +229,8 @@ public Q_SLOTS:
// Shutdown the Renderer Aspect while the OpenGL context
// is still valid
m_renderAspect->renderShutdown();
if (m_renderAspect)
m_renderAspect->renderShutdown();
}
// SGThread
@ -721,8 +722,9 @@ void Scene3DSGMaterialShader::updateState(const RenderState &state, QSGMaterial
void Scene3DCleaner::cleanup()
{
Q_ASSERT(m_renderer);
delete m_renderer->m_aspectEngine;
delete m_renderer->m_aspectEngine; // also deletes m_renderer->m_renderAspect
m_renderer->m_aspectEngine = Q_NULLPTR;
m_renderer->m_renderAspect = Q_NULLPTR;
m_renderer->deleteLater();
deleteLater();
}