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:
Adrien SCHVALBERG
2022-04-27 16:20:35 +02:00
committed by Thomas Krijnen
parent 93fd3f97e3
commit e677355438
20 changed files with 169 additions and 27 deletions
+10 -3
View File
@@ -12533,9 +12533,16 @@ IfcParse::schema_definition* IFC2X3_populate_schema() {
#pragma optimize("", on)
#endif
const schema_definition& Ifc2x3::get_schema() {
static std::unique_ptr<schema_definition> schema;
static const schema_definition* s = IFC2X3_populate_schema();
return *s;
void Ifc2x3::clear_schema() {
schema.reset();
}
const schema_definition& Ifc2x3::get_schema() {
if (!schema) {
schema.reset(IFC2X3_populate_schema());
}
return *schema;
}