Browse Source

Fixed d2d RenderTargetBitmap leak

pull/403/merge
Nikita Tsukanov 11 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> /// </summary>
public int PixelHeight => WicImpl.Size.Height; public int PixelHeight => WicImpl.Size.Height;
public virtual void Dispose()
{
WicImpl.Dispose();
}
/// <summary> /// <summary>
/// Gets the WIC implementation of the bitmap. /// Gets the WIC implementation of the bitmap.
/// </summary> /// </summary>

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

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

Loading…
Cancel
Save