mirror of
https://github.com/python/cpython.git
synced 2025-08-19 08:11:46 +00:00
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. ........
This commit is contained in:
parent
ba6c08e670
commit
607951d405
2 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
|
||||||
|
re-initializing a buffered IO object by calling its ``__init__`` method.
|
||||||
|
|
||||||
- Issue #8471: In doctest, properly reset the output stream to an empty
|
- Issue #8471: In doctest, properly reset the output stream to an empty
|
||||||
string when Unicode was previously output.
|
string when Unicode was previously output.
|
||||||
|
|
||||||
|
|
|
@ -636,6 +636,8 @@ _buffered_init(buffered *self)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifdef WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
|
if (self->lock)
|
||||||
|
PyThread_free_lock(self->lock);
|
||||||
self->lock = PyThread_allocate_lock();
|
self->lock = PyThread_allocate_lock();
|
||||||
if (self->lock == NULL) {
|
if (self->lock == NULL) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock");
|
PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue