From b0ccf698705af3a40cdb4d83828921081c42a8bb Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 19 Feb 2015 14:42:19 +0000 Subject: [PATCH] Don't add inverse references to the entity being added itself. --- src/ifcparse/IfcParse.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 8d4df67e0e..86e88bb523 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -1117,6 +1117,7 @@ IfcUtil::IfcBaseClass* IfcFile::addEntity(IfcUtil::IfcBaseClass* entity) { } catch (...) {} for (IfcEntityList::it it = entity_attributes->begin(); it != entity_attributes->end(); ++it) { IfcUtil::IfcBaseClass* entity_attribute = *it; + if (*it == entity) continue; try { if (!IfcSchema::Type::IsSimple(entity_attribute->type())) { unsigned entity_attribute_id = entity_attribute->entity->id();