From a03422f5d3a0780bfde5e4aa7ee05e1eb9a090fd Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Mon, 27 Feb 2012 13:51:02 +0100 Subject: Issue #14125: Fix multiprocessing refleak on Windows. Patch by sbt. --- Modules/_multiprocessing/win32_functions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Modules/_multiprocessing/win32_functions.c b/Modules/_multiprocessing/win32_functions.c index e175997..15aeeda 100644 --- a/Modules/_multiprocessing/win32_functions.c +++ b/Modules/_multiprocessing/win32_functions.c @@ -708,9 +708,12 @@ win32_WaitForMultipleObjects(PyObject* self, PyObject* args) PyObject *v = PySequence_GetItem(handle_seq, i); if (v == NULL) return NULL; - if (!PyArg_Parse(v, F_HANDLE, &h)) + if (!PyArg_Parse(v, F_HANDLE, &h)) { + Py_DECREF(v); return NULL; + } handles[i] = h; + Py_DECREF(v); } /* If this is the main thread then make the wait interruptible by Ctrl-C unless we are waiting for *all* handles */ -- cgit v0.12