Browse Source

Refactor IImageProcessor

af/merge-core
James Jackson-South 7 years ago
parent
commit
1efaba60c3
  1. 7
      src/ImageSharp/Processing/Processors/CloningImageProcessor{TPixel}.cs
  2. 8
      src/ImageSharp/Processing/Processors/ImageProcessor{TPixel}.cs

7
src/ImageSharp/Processing/Processors/CloningImageProcessor{TPixel}.cs

@ -15,8 +15,6 @@ namespace SixLabors.ImageSharp.Processing.Processors
internal abstract class CloningImageProcessor<TPixel> : ICloningImageProcessor<TPixel>
where TPixel : struct, IPixel<TPixel>
{
private bool isDisposed;
/// <summary>
/// Initializes a new instance of the <see cref="CloningImageProcessor{TPixel}"/> class.
/// </summary>
@ -104,6 +102,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
@ -160,10 +159,6 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <param name="disposing">Whether to dispose managed and unmanaged objects.</param>
protected virtual void Dispose(bool disposing)
{
if (!this.isDisposed)
{
this.isDisposed = true;
}
}
}
}

8
src/ImageSharp/Processing/Processors/ImageProcessor{TPixel}.cs

@ -15,8 +15,6 @@ namespace SixLabors.ImageSharp.Processing.Processors
internal abstract class ImageProcessor<TPixel> : IImageProcessor<TPixel>
where TPixel : struct, IPixel<TPixel>
{
private bool isDisposed;
/// <summary>
/// Initializes a new instance of the <see cref="ImageProcessor{TPixel}"/> class.
/// </summary>
@ -97,6 +95,8 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <inheritdoc/>
public virtual void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
@ -142,10 +142,6 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// <param name="disposing">Whether to dispose managed and unmanaged objects.</param>
protected virtual void Dispose(bool disposing)
{
if (!this.isDisposed)
{
this.isDisposed = true;
}
}
}
}

Loading…
Cancel
Save