From 97c3c7de0e78151d9e42398ab3e0b7451d0b2ba9 Mon Sep 17 00:00:00 2001 From: Sven Harazim Date: Fri, 9 Aug 2024 15:45:49 +0200 Subject: [PATCH] memory leak fixed --- intf.ZUGFeRDInvoiceDescriptor22Writer.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(