Skip to content

Commit 9d437b5

Browse files
committed
Mark simple type instance file ownership #7226
1 parent 1d0b467 commit 9d437b5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/ifcparse/IfcParse.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,11 @@ void IfcParse::impl::in_memory_file_storage::read_from_stream(IfcParse::FileRead
16071607
// Move the storage of simple type instances so that they are retained during the lifetime of the file
16081608
read_simple_type_instances = streamer.stealInstances();
16091609

1610+
// Set file ownership on simple type instances, so that when adding them to other files, proper copies are created
1611+
for (auto& inst : read_simple_type_instances) {
1612+
inst->file_ = file;
1613+
}
1614+
16101615
Logger::Status("\rDone scanning file ");
16111616

16121617
delete tokens;

0 commit comments

Comments
 (0)