From 1510b1445e405afe122012016434a8ebc9ca4aaf Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Wed, 18 Apr 2018 15:59:58 -0700 Subject: [PATCH] Remove the unused finalizer pattern from LzwEncoder The pattern is not relevant without a finalizer. --- src/ImageSharp/Formats/Gif/LzwEncoder.cs | 37 ++---------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/src/ImageSharp/Formats/Gif/LzwEncoder.cs b/src/ImageSharp/Formats/Gif/LzwEncoder.cs index 32ba6015bb..4f78daf9d4 100644 --- a/src/ImageSharp/Formats/Gif/LzwEncoder.cs +++ b/src/ImageSharp/Formats/Gif/LzwEncoder.cs @@ -83,19 +83,6 @@ namespace SixLabors.ImageSharp.Formats.Gif /// private readonly byte[] accumulators = new byte[256]; - /// - /// A value indicating whether this instance of the given entity has been disposed. - /// - /// if this instance has been disposed; otherwise, . - /// - /// If the entity is disposed, it must not be disposed a second - /// time. The isDisposed field is set the first time the entity - /// is disposed. If the isDisposed field is true, then the Dispose() - /// method will not dispose again. This help not to prolong the entity's - /// life in the Garbage Collector. - /// - private bool isDisposed; - /// /// The current pixel /// @@ -471,28 +458,8 @@ namespace SixLabors.ImageSharp.Formats.Gif /// public void Dispose() { - // Do not change this code. Put cleanup code in Dispose(bool disposing) above. - this.Dispose(true); - } - - /// - /// Disposes the object and frees resources for the Garbage Collector. - /// - /// If true, the object gets disposed. - private void Dispose(bool disposing) - { - if (this.isDisposed) - { - return; - } - - if (disposing) - { - this.hashTable?.Dispose(); - this.codeTable?.Dispose(); - } - - this.isDisposed = true; + this.hashTable?.Dispose(); + this.codeTable?.Dispose(); } } } \ No newline at end of file