Skip to content

Commit 060fbcb

Browse files
committed
Fix Memory Leak
1 parent 19b7492 commit 060fbcb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/wasm/geometry/IfcGeometryProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ namespace webifc::geometry
5151

5252
void IfcGeometryProcessor::Clear()
5353
{
54-
_expressIDToGeometry = {};
54+
_expressIDToGeometry.clear();
55+
std::unordered_map<uint32_t, IfcGeometry>().swap(_expressIDToGeometry);
5556
}
5657

5758
glm::dmat4 IfcGeometryProcessor::GetCoordinationMatrix()
@@ -798,7 +799,6 @@ namespace webifc::geometry
798799
mesh.color = glm::dvec4(1.0);
799800
else
800801
mesh.color = styledItemColor.value();
801-
_expressIDToMesh[expressID] = mesh;
802802
return mesh;
803803
}
804804
case schema::IFCEXTRUDEDAREASOLID:

src/wasm/geometry/IfcGeometryProcessor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace webifc::geometry
3939
IfcGeometry GetBrep(uint32_t expressID);
4040
IfcGeometry BoolProcess(const std::vector<IfcGeometry> &firstGroups, std::vector<IfcGeometry> &secondGroups, std::string op);
4141
std::unordered_map<uint32_t, IfcGeometry> _expressIDToGeometry;
42-
std::unordered_map<uint32_t, IfcComposedMesh> _expressIDToMesh;
4342
IfcSurface GetSurface(uint32_t expressID);
4443
const IfcGeometryLoader _geometryLoader;
4544
glm::dmat4 _transformation = glm::dmat4(1.0);

0 commit comments

Comments
 (0)