mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Add IfcParse::clear_schemas() and individual Ifc___::clear_schema() to clear any resource allocated by registered schemas
Add missing virtual destructors in IfcSchema.h
This commit is contained in:
committed by
Thomas Krijnen
parent
93fd3f97e3
commit
e677355438
@@ -283,10 +283,22 @@ __attribute__((optnone))
|
||||
|
||||
self.statements.extend(
|
||||
(
|
||||
"const schema_definition& %s::get_schema() {" % schema_name_title,
|
||||
"static std::unique_ptr<schema_definition> schema;",
|
||||
"",
|
||||
" static const schema_definition* s = %(schema_name)s_populate_schema();" % locals(),
|
||||
" return *s;",
|
||||
"void %s::clear_schema() {" % schema_name_title,
|
||||
" schema.reset();",
|
||||
"}",
|
||||
"",
|
||||
)
|
||||
)
|
||||
|
||||
self.statements.extend(
|
||||
(
|
||||
"const schema_definition& %s::get_schema() {" % schema_name_title,
|
||||
" if (!schema) {",
|
||||
" schema.reset(%(schema_name)s_populate_schema());" % locals(),
|
||||
" }",
|
||||
" return *schema;",
|
||||
"}",
|
||||
"",
|
||||
"",
|
||||
|
||||
@@ -38,6 +38,8 @@ struct %(schema_name)s {
|
||||
|
||||
IFC_PARSE_API static const IfcParse::schema_definition& get_schema();
|
||||
|
||||
IFC_PARSE_API static void clear_schema();
|
||||
|
||||
static const char* const Identifier;
|
||||
|
||||
// Forward definitions
|
||||
|
||||
Reference in New Issue
Block a user