mirror of https://github.com/axmolengine/axmol.git
Merge pull request #837 from dumganhar/gles20
fixed #1158: Fixed a bug in CCParticleSystemQuad. We need to check whether need to free quads and delete vbo/vao in the destructor. CCParticleSystemQuad::~CCParticleSystemQuad() { if (NULL == m_pBatchNode) // important { CC_SAFE_FREE(m_pQuads); CC_SAFE_FREE(m_pIndices); glDeleteBuffers(2, &m_pBuffersVBO[0]); glDeleteVertexArrays(1, &m_uVAOname); } }
This commit is contained in:
commit
be525c7e57
|
@ -76,10 +76,13 @@ CCParticleSystemQuad::CCParticleSystemQuad()
|
|||
|
||||
CCParticleSystemQuad::~CCParticleSystemQuad()
|
||||
{
|
||||
CC_SAFE_FREE(m_pQuads);
|
||||
CC_SAFE_FREE(m_pIndices);
|
||||
glDeleteBuffers(2, &m_pBuffersVBO[0]);
|
||||
glDeleteVertexArrays(1, &m_uVAOname);
|
||||
if (NULL == m_pBatchNode)
|
||||
{
|
||||
CC_SAFE_FREE(m_pQuads);
|
||||
CC_SAFE_FREE(m_pIndices);
|
||||
glDeleteBuffers(2, &m_pBuffersVBO[0]);
|
||||
glDeleteVertexArrays(1, &m_uVAOname);
|
||||
}
|
||||
}
|
||||
|
||||
// implementation CCParticleSystemQuad
|
||||
|
|
Loading…
Reference in New Issue