Skip to content

Commit 0b5483a

Browse files
committed
Fix memory leak
We should release the resource
1 parent 1eeb30a commit 0b5483a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dotnet/WPF/AcrylicEffect/AcrylicEffect/CompositionHostControl.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ async void LoadSurface(CompositionDrawingSurface surface, string path)
155155
var rect = new Windows.Foundation.Rect(0, 0, _rectWidth, _rectHeight);
156156
ds.DrawImage(bitmap, 0, 0, rect);
157157
}
158+
159+
stream.Dispose();
160+
bitmap.Dispose();
158161
}
159162

160163
IGraphicsEffect CreateAcrylicEffectGraph()

0 commit comments

Comments
 (0)