diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c5a4cca..410097cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Issue [#377](https://github.com/DanielChappuis/reactphysics3d/issues/377) Assert when destroying an empty PhysicsWorld - Issue [#378](https://github.com/DanielChappuis/reactphysics3d/issues/378) Wrong raycasting result against the HeightFieldShape +- Issue [#387](https://github.com/DanielChappuis/reactphysics3d/issues/387) Fix memory allocation issue when destroying a ConvexMesh - Fix crash within testbed application in raycasting scene - Fix robustness issue with CapsuleShape vs CapsuleShape collision diff --git a/src/engine/PhysicsCommon.cpp b/src/engine/PhysicsCommon.cpp index b4efcedb..fa536d69 100644 --- a/src/engine/PhysicsCommon.cpp +++ b/src/engine/PhysicsCommon.cpp @@ -617,7 +617,7 @@ ConvexMesh* PhysicsCommon::createConvexMesh(const PolygonVertexArray& polygonVer // If the mesh is not valid if (!isValid) { mesh->~ConvexMesh(); - allocator.release(mesh, sizeof(ConvexMesh)); + mMemoryManager.release(MemoryManager::AllocationType::Pool, mesh, sizeof(ConvexMesh)); return nullptr; } @@ -661,7 +661,7 @@ ConvexMesh* PhysicsCommon::createConvexMesh(const VertexArray& vertexArray, std: // If the mesh is not valid if (!isValid) { mesh->~ConvexMesh(); - allocator.release(mesh, sizeof(ConvexMesh)); + mMemoryManager.release(MemoryManager::AllocationType::Pool, mesh, sizeof(ConvexMesh)); return nullptr; }