mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Added !found condition to for loop to ensure that a valid processHandle can't be overwritten to avoid handle leaks.
This commit is contained in:
@@ -1264,7 +1264,7 @@ bool OrganizerCore::waitForProcessCompletion(HANDLE handle, LPDWORD exitCode)
|
||||
size_t count =
|
||||
std::min<size_t>(static_cast<size_t>(maxCount), numProcesses);
|
||||
if (count > 0) {
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
for (size_t i = 0; i < count && !found; ++i) {
|
||||
std::wstring processName = getProcessName(processes[i]);
|
||||
if (!boost::starts_with(processName, L"ModOrganizer.exe")) {
|
||||
if (!boost::starts_with(processName, L"unknown")) {
|
||||
|
||||
Reference in New Issue
Block a user