Browse Source

remove set to null from disposal

pull/2511/head
Poker 3 years ago
parent
commit
a6b8abe3e9
No known key found for this signature in database GPG Key ID: 720AFAD63099D9CB
  1. 9
      src/ImageSharp/Formats/Png/PngEncoder.cs
  2. 2
      src/ImageSharp/Formats/Png/PngEncoderCore.cs

9
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
/// <summary>
/// Initializes a new instance of the <see cref="PngEncoder"/> class.
/// </summary>
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;
/// <summary>
/// Gets the number of bits per sample or per palette index (not per pixel).

2
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!;
}
/// <summary>

Loading…
Cancel
Save