refactor(Edit): add Finalizer region

This commit is contained in:
tekh 2025-09-24 16:08:59 +02:00
parent ed4fd6ce96
commit 54c21556f6

View File

@ -16,7 +16,6 @@ namespace EnvelopeGenerator.PdfEditor
private readonly TOutputStream _outputStream; private readonly TOutputStream _outputStream;
private readonly PdfReader _reader; private readonly PdfReader _reader;
private readonly PdfWriter _writer; private readonly PdfWriter _writer;
private bool _disposed = false;
public Edit(TInputStream inputStream, TOutputStream outputStream) public Edit(TInputStream inputStream, TOutputStream outputStream)
{ {
@ -32,7 +31,9 @@ namespace EnvelopeGenerator.PdfEditor
return new Edit<MemoryStream, MemoryStream>(new MemoryStream(documentBytes), new MemoryStream()); return new Edit<MemoryStream, MemoryStream>(new MemoryStream(documentBytes), new MemoryStream());
} }
// Finalizer #region Finalizer
private bool _disposed = false;
~Edit() ~Edit()
{ {
// If Dispose is not called, clean up unmanaged resources // If Dispose is not called, clean up unmanaged resources
@ -88,5 +89,6 @@ namespace EnvelopeGenerator.PdfEditor
_disposed = true; _disposed = true;
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
#endregion
} }
} }