Skip to content

Commit a6b8abe

Browse files
committed
remove set to null from disposal
1 parent 316a839 commit a6b8abe

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/ImageSharp/Formats/Png/PngEncoder.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
3+
#nullable disable
34

45
using SixLabors.ImageSharp.Advanced;
56

@@ -13,11 +14,9 @@ public class PngEncoder : QuantizingImageEncoder
1314
/// <summary>
1415
/// Initializes a new instance of the <see cref="PngEncoder"/> class.
1516
/// </summary>
16-
public PngEncoder() =>
17-
18-
// We set the quantizer to null here to allow the underlying encoder to create a
19-
// quantizer with options appropriate to the encoding bit depth.
20-
this.Quantizer = null!;
17+
// We set the quantizer to null here to allow the underlying encoder to create a
18+
// quantizer with options appropriate to the encoding bit depth.
19+
public PngEncoder() => this.Quantizer = null;
2120

2221
/// <summary>
2322
/// Gets the number of bits per sample or per palette index (not per pixel).

src/ImageSharp/Formats/Png/PngEncoderCore.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ public void Dispose()
206206
{
207207
this.previousScanline?.Dispose();
208208
this.currentScanline?.Dispose();
209-
this.previousScanline = null!;
210-
this.currentScanline = null!;
211209
}
212210

213211
/// <summary>

0 commit comments

Comments
 (0)