Browse Source

Bugfix: Forgot to free a temporary allocation on an early out in HeightFieldShape::SetMaterials

Jorrit Rouwe 1 year ago
parent
commit
f4f8e61f4b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Jolt/Physics/Collision/Shape/HeightFieldShape.cpp

+ 1 - 0
Jolt/Physics/Collision/Shape/HeightFieldShape.cpp

@@ -1264,6 +1264,7 @@ bool HeightFieldShape::SetMaterials(uint inX, uint inY, uint inSizeX, uint inSiz
 	if (mMaterials.size() == 1)
 	{
 		// Only 1 material, we don't need to store the material indices
+		inAllocator.Free(material_remap_table, material_remap_table_size);
 		return true;
 	}