From 0b5483aeab13a3013f2fd429167d2585fdabf6de Mon Sep 17 00:00:00 2001 From: lindexi Date: Wed, 3 Jul 2019 19:25:28 +0800 Subject: [PATCH] Fix memory leak We should release the resource --- .../AcrylicEffect/AcrylicEffect/CompositionHostControl.xaml.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotnet/WPF/AcrylicEffect/AcrylicEffect/CompositionHostControl.xaml.cs b/dotnet/WPF/AcrylicEffect/AcrylicEffect/CompositionHostControl.xaml.cs index cbacdef..9f66310 100644 --- a/dotnet/WPF/AcrylicEffect/AcrylicEffect/CompositionHostControl.xaml.cs +++ b/dotnet/WPF/AcrylicEffect/AcrylicEffect/CompositionHostControl.xaml.cs @@ -155,6 +155,9 @@ async void LoadSurface(CompositionDrawingSurface surface, string path) var rect = new Windows.Foundation.Rect(0, 0, _rectWidth, _rectHeight); ds.DrawImage(bitmap, 0, 0, rect); } + + stream.Dispose(); + bitmap.Dispose(); } IGraphicsEffect CreateAcrylicEffectGraph()