diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-01 16:57:42 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-01 16:57:42 (GMT) |
commit | f6df1ee171967b05186de1111810e184adbe5bfa (patch) | |
tree | 0f0ec9f1cdebbf8ebb25ef7e8e7078e25d625434 /Modules/_io | |
parent | 686ee4fd3db413b24c49e5a6331d3ba5fb5d9b05 (diff) | |
download | cpython-f6df1ee171967b05186de1111810e184adbe5bfa.zip cpython-f6df1ee171967b05186de1111810e184adbe5bfa.tar.gz cpython-f6df1ee171967b05186de1111810e184adbe5bfa.tar.bz2 |
Merged revisions 83411 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83411 | antoine.pitrou | 2010-08-01 18:53:42 +0200 (dim., 01 août 2010) | 4 lines
Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
re-initializing a buffered IO object by calling its `__init__` method.
........
Diffstat (limited to 'Modules/_io')
-rw-r--r-- | Modules/_io/bufferedio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index b21ea71..c0c3acc 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -632,6 +632,8 @@ _buffered_init(buffered *self) return -1; } #ifdef WITH_THREAD + if (self->lock) + PyThread_free_lock(self->lock); self->lock = PyThread_allocate_lock(); if (self->lock == NULL) { PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock"); |