[issue9448] test_io leaks memory

Antoine Pitrou report at bugs.python.org
Sun Aug 1 18:40:06 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

Can you try the following patch:

diff -r 962e1a7a40fd Modules/_io/bufferedio.c
--- a/Modules/_io/bufferedio.c	Sun Aug 01 17:30:56 2010 +0200
+++ b/Modules/_io/bufferedio.c	Sun Aug 01 18:39:39 2010 +0200
@@ -636,6 +636,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");

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9448>
_______________________________________


More information about the Python-bugs-list mailing list