Skip to content

Commit 34f4aa4

Browse files
authored
Keep file_ as nullptr to not bypass addEntity() #7264
1 parent f05b0d9 commit 34f4aa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ifcparse/IfcFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ std::optional<std::tuple<size_t, const IfcParse::declaration*, IfcEntityInstance
748748
IfcUtil::IfcBaseClass* IfcParse::impl::rocks_db_file_storage::create(const IfcParse::declaration* decl) {
749749
if (decl->as_entity() || decl->as_type_declaration()) {
750750
auto* inst = file->schema()->instantiate(decl, rocks_db_attribute_storage{});
751-
inst->file_ = file;
751+
inst->file_ = nullptr;
752752
return file->addEntity(inst);
753753
} else {
754754
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
764764
} else {
765765
throw std::runtime_error("Requires and entity or type declaration");
766766
}
767-
inst->file_ = file;
767+
inst->file_ = nullptr;
768768
return file->addEntity(inst);
769769
}

0 commit comments

Comments
 (0)