diff --git a/cocos2d/CCDrawNode.m b/cocos2d/CCDrawNode.m index 24b6adeb8..253620e71 100644 --- a/cocos2d/CCDrawNode.m +++ b/cocos2d/CCDrawNode.m @@ -162,6 +162,7 @@ -(void)dealloc glDeleteBuffers(1, &_vbo); _vbo = 0; glDeleteVertexArrays(1, &_vao); _vao = 0; + ccGLBindVAO(0); [super dealloc]; } diff --git a/cocos2d/CCParticleSystemQuad.m b/cocos2d/CCParticleSystemQuad.m index c60b5b4fa..28ad1e78d 100644 --- a/cocos2d/CCParticleSystemQuad.m +++ b/cocos2d/CCParticleSystemQuad.m @@ -162,6 +162,7 @@ - (void) setTotalParticles:(NSUInteger)tp // clean VAO glDeleteBuffers(2, &_buffersVBO[0]); glDeleteVertexArrays(1, &_VAOname); + ccGLBindVAO(0); [self initVAO]; } @@ -227,6 +228,7 @@ -(void) dealloc glDeleteBuffers(2, &_buffersVBO[0]); glDeleteVertexArrays(1, &_VAOname); + ccGLBindVAO(0); } [super dealloc]; @@ -489,6 +491,7 @@ -(void) setBatchNode:(CCParticleBatchNode *)batchNode glDeleteBuffers(2, &_buffersVBO[0]); glDeleteVertexArrays(1, &_VAOname); + ccGLBindVAO(0); } } } diff --git a/cocos2d/CCTextureAtlas.m b/cocos2d/CCTextureAtlas.m index ccf6f1ca8..ff8e00e3b 100644 --- a/cocos2d/CCTextureAtlas.m +++ b/cocos2d/CCTextureAtlas.m @@ -140,6 +140,7 @@ -(void) dealloc #if CC_TEXTURE_ATLAS_USE_VAO glDeleteVertexArrays(1, &_VAOname); + ccGLBindVAO(0); #endif [_texture release];