-
-
Notifications
You must be signed in to change notification settings - Fork 266
Open
Description
The bitmap handle acquired after calling GetThumbnail() is never released.
SharpShell should provide a way to release it (eg: by returning a IDisposable instance). Otherwise after many calls memory leak occurs (Windows is likely to get out of handle and GDI+ errors will arise).
Here is my workaround :
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
public static extern bool DeleteObject(IntPtr hObject);
if (thumbnail.GetThumbnail(..., out IntPtr bitmapHandle, out ...) == 0)
{
try
{
...
}
finally
{
DeleteObject(bitmapHandle);
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels