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:
@@ -68,6 +68,8 @@ static bool launchSoffice( )
|
||||
if ( !bSuccess )
|
||||
return false;
|
||||
|
||||
CloseHandle(aProcessInfo.hProcess);
|
||||
CloseHandle(aProcessInfo.hThread);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -576,6 +576,8 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(
|
||||
|
||||
return osl_Process_E_None;
|
||||
}
|
||||
else
|
||||
CloseHandle(process_info.hProcess);
|
||||
}
|
||||
|
||||
/* if an error occurred we have to close the server side pipe ends too */
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user