Fix leak with VAOManager

Change-Id: I09f15de230c571adb580bdbb3250405f562f255b
Task-number: QTBUG-70892
Reviewed-by: Juan José Casafranca <juan.casafranca@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
Paul Lemire 2018-10-03 08:46:28 +02:00
parent c19036f848
commit ff07ec93db
3 changed files with 8 additions and 1 deletions

View File

@ -108,6 +108,11 @@ void OpenGLVertexArrayObject::create(SubmissionContext *ctx, const VAOIdentifier
m_owners = key;
}
VAOIdentifier OpenGLVertexArrayObject::key() const
{
return m_owners;
}
// called from Render thread
void OpenGLVertexArrayObject::destroy()
{

View File

@ -73,6 +73,7 @@ public:
void release();
void create(SubmissionContext *ctx, const VAOIdentifier &key);
VAOIdentifier key() const;
void destroy();
void cleanup();

View File

@ -2142,7 +2142,8 @@ void Renderer::cleanGraphicsResources()
OpenGLVertexArrayObject *vao = m_nodesManager->vaoManager()->data(vaoHandle);
if (vao) {
vao->destroy();
m_nodesManager->vaoManager()->release(vaoHandle);
// We remove VAO from manager using its VAOIdentifier
m_nodesManager->vaoManager()->releaseResource(vao->key());
}
}
}