mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Peek]Fix memory leak caused by unmanaged bitmaps not being freed (#34484)
This commit is contained in:
@@ -154,6 +154,9 @@ namespace Peek.FilePreviewer
|
|||||||
_cancellationTokenSource.Cancel();
|
_cancellationTokenSource.Cancel();
|
||||||
_cancellationTokenSource = new();
|
_cancellationTokenSource = new();
|
||||||
|
|
||||||
|
// Clear up any unmanaged resources before creating a new previewer instance.
|
||||||
|
(Previewer as IDisposable)?.Dispose();
|
||||||
|
|
||||||
if (Item == null)
|
if (Item == null)
|
||||||
{
|
{
|
||||||
Previewer = null;
|
Previewer = null;
|
||||||
|
|||||||
@@ -103,12 +103,6 @@
|
|||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Page Update="Controls\UnsupportedFilePreview\FailedFallbackPreviewControl.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="FilePreview.xaml">
|
<Page Update="FilePreview.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
Reference in New Issue
Block a user