mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +00:00
erase enitty mapping upon deletion
This commit is contained in:
@@ -1904,6 +1904,16 @@ void IfcFile::removeEntity(IfcUtil::IfcBaseClass* entity) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This entity_file_map remains obviously flawed, but until we have proper lookup by value, or another mechanism,
|
||||||
|
// to prevent duplicate definitions with usage of add() we have to keep it. This might be a good moment to clear it.
|
||||||
|
for (auto it = entity_file_map.begin(); it != entity_file_map.end();) {
|
||||||
|
if (it->second == entity) {
|
||||||
|
it = entity_file_map.erase(it);
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete entity;
|
delete entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user