diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-05-03 14:57:01 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-05-05 09:45:27 +0300 |
commit | d6c1aadb3ee366ce8fd40da43fb65128ab3b2d44 (patch) | |
tree | 5a0a679c02738138aaad95b8a1311c71b4bd6d23 /src/datavisualizationqml2/glstatestore.cpp | |
parent | 370705e2246df38f1c3e83fe7231e61a611738ea (diff) |
Fix some simple memory leaks
Make sure all GLint arrays get deleted and also with delete [].
Change-Id: I5ec46eed85f78aee87696986b96ef02f201a9be3
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavisualizationqml2/glstatestore.cpp')
-rw-r--r-- | src/datavisualizationqml2/glstatestore.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/datavisualizationqml2/glstatestore.cpp b/src/datavisualizationqml2/glstatestore.cpp index f053078b..6fbd3a34 100644 --- a/src/datavisualizationqml2/glstatestore.cpp +++ b/src/datavisualizationqml2/glstatestore.cpp @@ -50,13 +50,13 @@ GLStateStore::GLStateStore(QOpenGLContext *context, QObject *parent) : #endif m_maxVertexAttribs = qMin(maxVertexAttribs, 2); // Datavis only uses 2 attribs max - m_vertexAttribArrayEnabledStates = new GLint[maxVertexAttribs]; - m_vertexAttribArrayBoundBuffers = new GLint[maxVertexAttribs]; - m_vertexAttribArraySizes = new GLint[maxVertexAttribs]; - m_vertexAttribArrayTypes = new GLint[maxVertexAttribs]; - m_vertexAttribArrayNormalized = new GLint[maxVertexAttribs]; - m_vertexAttribArrayStrides = new GLint[maxVertexAttribs]; - m_vertexAttribArrayOffsets = new GLint[maxVertexAttribs]; + m_vertexAttribArrayEnabledStates.reset(new GLint[maxVertexAttribs]); + m_vertexAttribArrayBoundBuffers.reset(new GLint[maxVertexAttribs]); + m_vertexAttribArraySizes.reset(new GLint[maxVertexAttribs]); + m_vertexAttribArrayTypes.reset(new GLint[maxVertexAttribs]); + m_vertexAttribArrayNormalized.reset(new GLint[maxVertexAttribs]); + m_vertexAttribArrayStrides.reset(new GLint[maxVertexAttribs]); + m_vertexAttribArrayOffsets.reset(new GLint[maxVertexAttribs]); initGLDefaultState(); } @@ -67,8 +67,6 @@ GLStateStore::~GLStateStore() EnumToStringMap::deleteInstance(); m_map = 0; #endif - delete m_vertexAttribArrayEnabledStates; - delete m_vertexAttribArrayBoundBuffers; } void GLStateStore::storeGLState() |