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