mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-29 08:13:14 +00:00
Initialize header schema in constructor and not statically #7131
This commit is contained in:
@@ -72,6 +72,8 @@ IfcParse::IfcSpfHeader::IfcSpfHeader(IfcParse::IfcFile* file)
|
|||||||
file_name_(nullptr),
|
file_name_(nullptr),
|
||||||
file_schema_(nullptr)
|
file_schema_(nullptr)
|
||||||
{
|
{
|
||||||
|
Header_section_schema::get_schema();
|
||||||
|
|
||||||
if (file == nullptr) {
|
if (file == nullptr) {
|
||||||
// overwritten later in IfcFile::setDefaultHeaderValues() when we know the schema identifier
|
// overwritten later in IfcFile::setDefaultHeaderValues() when we know the schema identifier
|
||||||
file_description_ = new Header_section_schema::file_description({}, "");
|
file_description_ = new Header_section_schema::file_description({}, "");
|
||||||
@@ -101,6 +103,8 @@ IfcParse::IfcSpfHeader::IfcSpfHeader(IfcParse::IfcFile* file)
|
|||||||
|
|
||||||
IfcParse::IfcSpfHeader::IfcSpfHeader(IfcParse::IfcSpfLexer* lexer)
|
IfcParse::IfcSpfHeader::IfcSpfHeader(IfcParse::IfcSpfLexer* lexer)
|
||||||
{
|
{
|
||||||
|
Header_section_schema::get_schema();
|
||||||
|
|
||||||
storage_ = new impl::in_memory_file_storage;
|
storage_ = new impl::in_memory_file_storage;
|
||||||
storage_->tokens = lexer;
|
storage_->tokens = lexer;
|
||||||
file_ = nullptr;
|
file_ = nullptr;
|
||||||
@@ -284,5 +288,3 @@ Header_section_schema::file_schema* IfcParse::IfcSpfHeader::file_schema() {
|
|||||||
|
|
||||||
return file_schema_;
|
return file_schema_;
|
||||||
}
|
}
|
||||||
|
|
||||||
static auto& _ = Header_section_schema::get_schema();
|
|
||||||
|
|||||||
Reference in New Issue
Block a user