Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion IronSoftware.Drawing/IronSoftware.Drawing.Common/AnyBitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace IronSoftware.Drawing
/// </summary>
public partial class AnyBitmap : IDisposable
{
private bool disposed = false;
private SixLabors.ImageSharp.Image Image { get; set; }
private byte[] Binary { get; set; }
private IImageFormat Format { get; set; }
Expand Down Expand Up @@ -1189,12 +1190,24 @@ public enum ImageFormat

}

/// <summary>
/// AnyBitmap destructor
/// </summary>
~AnyBitmap()
{
this.Dispose();
}

/// <summary>
/// Releases all resources used by this <see cref="IronSoftware.Drawing.AnyBitmap"/>.
/// </summary>
public void Dispose()
{
Image.Dispose();
if (this.disposed)
return;
this.Image.Dispose();
this.Image = null;
this.disposed = true;
}

#region Private Method
Expand Down