From 4cf66362afd56a40f4f7093be46e3deefca9cb90 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Wed, 11 Jun 2025 16:52:19 +0800 Subject: [PATCH] Fix handle close issue --- Flow.Launcher.Infrastructure/Win32Helper.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 45b26b58e..cfc73ad90 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -929,6 +929,11 @@ retry: } } + if (pi.hProcess != HANDLE.Null) PInvoke.CloseHandle(pi.hProcess); + if (pi.hThread != HANDLE.Null) PInvoke.CloseHandle(pi.hThread); + if (hShellProcessToken != HANDLE.Null) PInvoke.CloseHandle(hShellProcessToken); + if (hPrimaryToken != HANDLE.Null) PInvoke.CloseHandle(hPrimaryToken); + if (hShellProcess != HANDLE.Null) PInvoke.CloseHandle(hShellProcess); return true; cleanup: