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
@@ -15071,9 +15071,16 @@ IfcParse::schema_definition* IFC4_populate_schema() {
#pragma optimize("", on)
#endif
const schema_definition& Ifc4::get_schema() {
static std::unique_ptr<schema_definition> schema;
static const schema_definition* s = IFC4_populate_schema();
return *s;
void Ifc4::clear_schema() {
schema.reset();
}
const schema_definition& Ifc4::get_schema() {
if (!schema) {
schema.reset(IFC4_populate_schema());
}
return *schema;
}