fix memory leak (#20423)

This commit is contained in:
coulsonwang 2020-01-06 09:34:53 +08:00 committed by halx99
parent a0e24c4c42
commit 69b1f6f8fd
1 changed files with 1 additions and 0 deletions

View File

@ -130,6 +130,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata)
{ {
auto& index = meshdata.subMeshIndices[i]; auto& index = meshdata.subMeshIndices[i];
auto indexBuffer = backend::Device::getInstance()->newBuffer(index.size() * sizeof(index[0]), backend::BufferType::INDEX, backend::BufferUsage::STATIC); auto indexBuffer = backend::Device::getInstance()->newBuffer(index.size() * sizeof(index[0]), backend::BufferType::INDEX, backend::BufferUsage::STATIC);
indexBuffer->autorelease();
#if CC_ENABLE_CACHE_TEXTURE_DATA #if CC_ENABLE_CACHE_TEXTURE_DATA
indexBuffer->usingDefaultStoredData(false); indexBuffer->usingDefaultStoredData(false);
#endif #endif