From 34f4aa430aafc43ffa4028cdec23716fe6c0d9d5 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 20 Oct 2025 10:33:09 +0200 Subject: [PATCH] Keep file_ as nullptr to not bypass addEntity() #7264 --- src/ifcparse/IfcFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }