mirror of https://github.com/qt/qt3d.git
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:
parent
c19036f848
commit
ff07ec93db
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ public:
|
|||
void release();
|
||||
|
||||
void create(SubmissionContext *ctx, const VAOIdentifier &key);
|
||||
VAOIdentifier key() const;
|
||||
void destroy();
|
||||
void cleanup();
|
||||
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue