diff --git a/src/ifcparse/IfcFile.cpp b/src/ifcparse/IfcFile.cpp index 25cd414c4c..2a00f313b2 100644 --- a/src/ifcparse/IfcFile.cpp +++ b/src/ifcparse/IfcFile.cpp @@ -748,7 +748,7 @@ std::optionalas_entity() || decl->as_type_declaration()) { auto* inst = file->schema()->instantiate(decl, rocks_db_attribute_storage{}); - inst->file_ = file; + inst->file_ = nullptr; return file->addEntity(inst); } else { throw std::runtime_error("Requires and entity or type declaration"); @@ -764,6 +764,6 @@ IfcUtil::IfcBaseClass* IfcParse::impl::in_memory_file_storage::create(const IfcP } else { throw std::runtime_error("Requires and entity or type declaration"); } - inst->file_ = file; + inst->file_ = nullptr; return file->addEntity(inst); }