diff --git a/cocos/renderer/CCQuadCommand.cpp b/cocos/renderer/CCQuadCommand.cpp index 286093b50f27..55cdfddddca5 100644 --- a/cocos/renderer/CCQuadCommand.cpp +++ b/cocos/renderer/CCQuadCommand.cpp @@ -68,8 +68,9 @@ void QuadCommand::reIndex(int indicesCount) CCLOG("cocos2d: QuadCommand: resizing index size from [%d] to [%d]", __indexCapacity, indicesCount); - _ownedIndices.push_back(__indices); + //bugfix memory leak problem of __indices __indices = new (std::nothrow) uint16_t[indicesCount]; + _ownedIndices.push_back(__indices); __indexCapacity = indicesCount; }