Skip to content

Commit

Permalink
[Peek]Fix memory leak caused by unmanaged bitmaps not being freed (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
daverayment committed Sep 16, 2024
1 parent 37f2154 commit 9bfee34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/modules/peek/Peek.FilePreviewer/FilePreview.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ private async Task OnItemPropertyChanged()
_cancellationTokenSource.Cancel();
_cancellationTokenSource = new();

// Clear up any unmanaged resources before creating a new previewer instance.
(Previewer as IDisposable)?.Dispose();

if (Item == null)
{
Previewer = null;
Expand Down
6 changes: 0 additions & 6 deletions src/modules/peek/Peek.FilePreviewer/Peek.FilePreviewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 9bfee34

Please sign in to comment.