From 69b1f6f8fdc6c01240e9c8384cae0fa2f0a3604b Mon Sep 17 00:00:00 2001 From: coulsonwang Date: Mon, 6 Jan 2020 09:34:53 +0800 Subject: [PATCH] fix memory leak (#20423) --- cocos/3d/CCMeshVertexIndexData.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/3d/CCMeshVertexIndexData.cpp b/cocos/3d/CCMeshVertexIndexData.cpp index a185dac716..b17fc2e03f 100644 --- a/cocos/3d/CCMeshVertexIndexData.cpp +++ b/cocos/3d/CCMeshVertexIndexData.cpp @@ -130,6 +130,7 @@ MeshVertexData* MeshVertexData::create(const MeshData& meshdata) { auto& index = meshdata.subMeshIndices[i]; 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 indexBuffer->usingDefaultStoredData(false); #endif