diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-02-27 12:51:02 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-02-27 12:51:02 (GMT) |
commit | a03422f5d3a0780bfde5e4aa7ee05e1eb9a090fd (patch) | |
tree | 32dd2d0a0504346d756fe4f8c3ca3d8cca10548d | |
parent | bd2c199b2b3b0a60a1feb9e16063ca3d83322137 (diff) | |
download | cpython-a03422f5d3a0780bfde5e4aa7ee05e1eb9a090fd.zip cpython-a03422f5d3a0780bfde5e4aa7ee05e1eb9a090fd.tar.gz cpython-a03422f5d3a0780bfde5e4aa7ee05e1eb9a090fd.tar.bz2 |
Issue #14125: Fix multiprocessing refleak on Windows. Patch by sbt.
-rw-r--r-- | Modules/_multiprocessing/win32_functions.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 */ |