From a6b8abe3e9cf08d3701ae29d9ea7a8b2fb85e22e Mon Sep 17 00:00:00 2001 From: Poker Date: Tue, 22 Aug 2023 08:00:49 +0800 Subject: [PATCH] remove set to null from disposal --- src/ImageSharp/Formats/Png/PngEncoder.cs | 9 ++++----- src/ImageSharp/Formats/Png/PngEncoderCore.cs | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ImageSharp/Formats/Png/PngEncoder.cs b/src/ImageSharp/Formats/Png/PngEncoder.cs index a4ae1ca0b..a8c1de939 100644 --- a/src/ImageSharp/Formats/Png/PngEncoder.cs +++ b/src/ImageSharp/Formats/Png/PngEncoder.cs @@ -1,5 +1,6 @@ // Copyright (c) Six Labors. // Licensed under the Six Labors Split License. +#nullable disable using SixLabors.ImageSharp.Advanced; @@ -13,11 +14,9 @@ public class PngEncoder : QuantizingImageEncoder /// /// Initializes a new instance of the class. /// - public PngEncoder() => - - // We set the quantizer to null here to allow the underlying encoder to create a - // quantizer with options appropriate to the encoding bit depth. - this.Quantizer = null!; + // We set the quantizer to null here to allow the underlying encoder to create a + // quantizer with options appropriate to the encoding bit depth. + public PngEncoder() => this.Quantizer = null; /// /// Gets the number of bits per sample or per palette index (not per pixel). diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index 17fb40446..509837e70 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -206,8 +206,6 @@ internal sealed class PngEncoderCore : IImageEncoderInternals, IDisposable { this.previousScanline?.Dispose(); this.currentScanline?.Dispose(); - this.previousScanline = null!; - this.currentScanline = null!; } ///