Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a03422f

Browse files
author
Stefan Krah
committed
Issue #14125: Fix multiprocessing refleak on Windows. Patch by sbt.
1 parent bd2c199 commit a03422f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Modules/_multiprocessing/win32_functions.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,12 @@ win32_WaitForMultipleObjects(PyObject* self, PyObject* args)
708708
PyObject *v = PySequence_GetItem(handle_seq, i);
709709
if (v == NULL)
710710
return NULL;
711-
if (!PyArg_Parse(v, F_HANDLE, &h))
711+
if (!PyArg_Parse(v, F_HANDLE, &h)) {
712+
Py_DECREF(v);
712713
return NULL;
714+
}
713715
handles[i] = h;
716+
Py_DECREF(v);
714717
}
715718
/* If this is the main thread then make the wait interruptible
716719
by Ctrl-C unless we are waiting for *all* handles */

0 commit comments

Comments
 (0)