summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2025-01-08 09:51:25 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2025-01-08 11:37:01 +0100
commitf468593d901b9f4ad8e90b6e101d17e6d490b5ef (patch)
tree18e32f5fefc6d54297e48f6ee6997542c228a4b0
parent9884f7aa793b4bacfd6780db498a2c40e7a134c1 (diff)
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
-rw-r--r--desktop/win32/source/QuickStart/QuickStart.cxx2
-rw-r--r--sal/osl/w32/procimpl.cxx2
-rw-r--r--setup_native/source/win32/customactions/reg_dlls/reg_dlls.cxx1
3 files changed, 5 insertions, 0 deletions
diff --git a/desktop/win32/source/QuickStart/QuickStart.cxx b/desktop/win32/source/QuickStart/QuickStart.cxx
index 3277a6abfe5a..707f60341823 100644
--- a/desktop/win32/source/QuickStart/QuickStart.cxx
+++ b/desktop/win32/source/QuickStart/QuickStart.cxx
@@ -68,6 +68,8 @@ static bool launchSoffice( )
if ( !bSuccess )
return false;
+ CloseHandle(aProcessInfo.hProcess);
+ CloseHandle(aProcessInfo.hThread);
return true;
}
else
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index f36a3c90b073..d271c391eed7 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -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 */
diff --git a/setup_native/source/win32/customactions/reg_dlls/reg_dlls.cxx b/setup_native/source/win32/customactions/reg_dlls/reg_dlls.cxx
index b1e204a80d12..8231e3c5e3cb 100644
--- a/setup_native/source/win32/customactions/reg_dlls/reg_dlls.cxx
+++ b/setup_native/source/win32/customactions/reg_dlls/reg_dlls.cxx
@@ -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");