diff --git a/intf.ZUGFeRDInvoiceDescriptor22Writer.pas b/intf.ZUGFeRDInvoiceDescriptor22Writer.pas index 65f9952..9c1578d 100644 --- a/intf.ZUGFeRDInvoiceDescriptor22Writer.pas +++ b/intf.ZUGFeRDInvoiceDescriptor22Writer.pas @@ -107,8 +107,11 @@ procedure TZUGFeRDInvoiceDescriptor22Writer.Save( _writer := TZUGFeRDInvoiceDescriptor22UBLWriter.Create else _writer := TZUGFeRDInvoiceDescriptor22CIIWriter.Create; - - _writer.Save(_descriptor, _stream, _format); + try + _writer.Save(_descriptor, _stream, _format); + finally + _writer.Free; + end; end; function TZUGFeRDInvoiceDescriptor22Writer.Validate(