You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/app/src/sys/win/process.c b/app/src/sys/win/process.c
index 6e9da09c9..6ae33d86d 100644
--- a/app/src/sys/win/process.c+++ b/app/src/sys/win/process.c@@ -176,6 +176,8 @@ sc_process_execute_p(const char *const argv[], HANDLE *handle, unsigned flags,
free(lpAttributeList);
}
+ CloseHandle(pi.hThread);+
// These handles are used by the child process, close them for this process
if (pin) {
CloseHandle(stdin_read_handle);
In particular, that it is correct to close pi.hThread immediately? (Otherwise I will test later when I have access to a Windows machine)
Environment
Describe the bug
A systematic Handle Leak is observed during debug-sessions.
Our analysis has shown, that in file:
scrcpy/app/src/sys/win/process.c
after a successful call of
BOOL ok = CreateProcessW(NULL, wide, NULL, NULL, bInheritHandles, dwCreationFlags, NULL, NULL, &si.StartupInfo, &pi);
the (nominal) call to
CloseHandle(pi.hThread);
is missing.
Please refer to the official Microsoft documentation
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw
Quote:
"Handles in PROCESS_INFORMATION must be closed with CloseHandle when they are no longer needed."
The text was updated successfully, but these errors were encountered: