diff --git a/src/ifcgeom_schema_agnostic/IfcGeomIterator.h b/src/ifcgeom_schema_agnostic/IfcGeomIterator.h index 04437e58a4..4f45c108a1 100644 --- a/src/ifcgeom_schema_agnostic/IfcGeomIterator.h +++ b/src/ifcgeom_schema_agnostic/IfcGeomIterator.h @@ -107,6 +107,10 @@ namespace IfcGeom { } } + ~Iterator() { + delete implementation_; + } + bool initialize() { if (implementation_) { return implementation_->initialize(); diff --git a/src/ifcgeom_schema_agnostic/IteratorImplementation.h b/src/ifcgeom_schema_agnostic/IteratorImplementation.h index fc9ca78aeb..7879263264 100644 --- a/src/ifcgeom_schema_agnostic/IteratorImplementation.h +++ b/src/ifcgeom_schema_agnostic/IteratorImplementation.h @@ -73,6 +73,7 @@ namespace IfcGeom { virtual BRepElement* get_native() = 0; virtual const Element* get_object(int id) = 0; virtual IfcUtil::IfcBaseClass* create() = 0; + virtual ~IteratorImplementation() {} }; }