From dcebf23af85b36f22950ea1d880e0383159c5ff6 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 12 Jun 2026 11:41:11 +0200 Subject: [PATCH] Workaround for header construction order --- src/ifcparse/IfcSpfHeader.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/ifcparse/IfcSpfHeader.cpp b/src/ifcparse/IfcSpfHeader.cpp index fd4c80e51a..efb30c90a2 100644 --- a/src/ifcparse/IfcSpfHeader.cpp +++ b/src/ifcparse/IfcSpfHeader.cpp @@ -95,14 +95,8 @@ IfcParse::IfcSpfHeader::IfcSpfHeader(IfcParse::IfcFile* file, Logger& logger) return nullptr; }, file_->storage_); - if (storage_ == nullptr) { - file_description_ = Header_section_schema::get_schema().instantiate(&Header_section_schema::file_description::Class(), IfcEntityInstanceData(rocks_db_attribute_storage{}))->as(); - file_description_->file_ = file_; - file_name_ = Header_section_schema::get_schema().instantiate(&Header_section_schema::file_name::Class(), IfcEntityInstanceData(rocks_db_attribute_storage{}))->as(); - file_name_->file_ = file_; - file_schema_ = Header_section_schema::get_schema().instantiate(&Header_section_schema::file_schema::Class(), IfcEntityInstanceData(rocks_db_attribute_storage{}))->as(); - file_schema_->file_ = file_; - } + // IfcFile constructs _header before it emplaces the selected storage backend. + // Keep header entities lazy so the accessors below allocate against the final storage. } }