Browse Source

Fixed d2d RenderTargetBitmap leak

pull/403/merge
Nikita Tsukanov 10 years ago
parent
commit
36515e05d7
  1. 5
      src/Windows/Perspex.Direct2D1/Media/Imaging/BitmapImpl.cs
  2. 5
      src/Windows/Perspex.Direct2D1/Media/Imaging/RenderTargetBitmapImpl.cs

5
src/Windows/Perspex.Direct2D1/Media/Imaging/BitmapImpl.cs

@ -74,6 +74,11 @@ namespace Perspex.Direct2D1.Media
/// </summary>
public int PixelHeight => WicImpl.Size.Height;
public virtual void Dispose()
{
WicImpl.Dispose();
}
/// <summary>
/// Gets the WIC implementation of the bitmap.
/// </summary>

5
src/Windows/Perspex.Direct2D1/Media/Imaging/RenderTargetBitmapImpl.cs

@ -33,9 +33,10 @@ namespace Perspex.Direct2D1.Media
props);
}
public void Dispose()
public override void Dispose()
{
// TODO:
_target.Dispose();
base.Dispose();
}
public Perspex.Media.DrawingContext CreateDrawingContext() => new RenderTarget(_target).CreateDrawingContext();

Loading…
Cancel
Save