Close handles properly

Change-Id: If8620229d41ae9b6c0a1714967a8bb6d51d3ba0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179939
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski
2025-01-08 11:37:01 +01:00
parent 9884f7aa79
commit f468593d90
3 changed files with 5 additions and 0 deletions
@@ -168,6 +168,7 @@ void RegDLL(MSIHANDLE hInst, const std::wstring& sArgs, bool bUnreg)
if (!CreateProcessW(sRegSvr32.c_str(), const_cast<LPWSTR>(sCmd.c_str()), nullptr, nullptr,
FALSE, CREATE_NO_WINDOW, nullptr, nullptr, &si, &pi))
ThrowLastError("CreateProcessW");
CloseHandle(pi.hThread);
auto aCloseProcHandleGuard(Guard(pi.hProcess));
WriteLog(hInst, "CreateProcessW succeeded");