Closed daverayment closed 3 weeks ago
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
Note: You can give me feedback by 👍 or 👎 this comment.
This issue has been worked on during the 0.85 development cycle. Please update to the latest release.
Microsoft PowerToys version
0.83.0
Installation method
PowerToys auto-update
Running as admin
No
Area(s) with issue?
Peek
Steps to reproduce
Use Peek to preview an audio file, a 'special folder' (e.g. one containing images where their thumbnails are shown on the folder itself), an unsupported file, or a drive. The icon subsequently displayed in the Peek UI is retrieved using the
IconHelper
in thePeek.FilePreviewer.Previewers.Helpers
namespace.In
IconHelper.GetImageAsync()
, the handle for the retrieved icon bitmap is set to IntPtr.Zero immediately after being retrieved, instead of being disposed of usingNativeMethods.DeleteObject
in the finally block. The handle's resource is never freed and remains in memory:I have a fix for this and other thumbnail-related issues. As they are interrelated, I would like to tackle them in a single PR.
✔️ Expected Behavior
After navigating to an item where an icon graphic is shown in the previewer, the unmanaged bitmap resource is correctly freed.
❌ Actual Behavior
The unmanaged bitmap memory for the icon is not freed, taking up process memory.
Other Software
No response