[Peek]Fix memory leak caused by unmanaged bitmaps not being freed (#34484)

This commit is contained in:
Dave Rayment
2024-09-16 21:10:51 +01:00
committed by GitHub
parent 37f2154c86
commit 9bfee34265
2 changed files with 3 additions and 6 deletions

View File

@@ -154,6 +154,9 @@ namespace Peek.FilePreviewer
_cancellationTokenSource.Cancel();
_cancellationTokenSource = new();
// Clear up any unmanaged resources before creating a new previewer instance.
(Previewer as IDisposable)?.Dispose();
if (Item == null)
{
Previewer = null;

View File

@@ -103,12 +103,6 @@
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="Controls\UnsupportedFilePreview\FailedFallbackPreviewControl.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="FilePreview.xaml">
<Generator>MSBuild:Compile</Generator>