mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix possible double release
This commit is contained in:
parent
49fc0b8fd0
commit
8a05c606e4
1 changed files with 5 additions and 1 deletions
|
|
@ -62,6 +62,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
if (nativeShellItem is not IShellItemImageFactory imageFactory)
|
||||
{
|
||||
Marshal.ReleaseComObject(nativeShellItem);
|
||||
nativeShellItem = null;
|
||||
throw new InvalidOperationException("Failed to get IShellItemImageFactory");
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +87,10 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
}
|
||||
finally
|
||||
{
|
||||
Marshal.ReleaseComObject(nativeShellItem);
|
||||
if (nativeShellItem != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(nativeShellItem);
|
||||
}
|
||||
}
|
||||
|
||||
return hBitmap;
|
||||
|
|
|
|||
Loading…
Reference in a new issue