mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #6242: Fix deallocator of io.StringIO and io.BytesIO.
This commit is contained in:
parent
4f1f422713
commit
fc477048e1
3 changed files with 17 additions and 6 deletions
|
|
@ -509,11 +509,15 @@ static void
|
|||
stringio_dealloc(stringio *self)
|
||||
{
|
||||
_PyObject_GC_UNTRACK(self);
|
||||
self->ok = 0;
|
||||
if (self->buf) {
|
||||
PyMem_Free(self->buf);
|
||||
self->buf = NULL;
|
||||
}
|
||||
Py_CLEAR(self->readnl);
|
||||
Py_CLEAR(self->writenl);
|
||||
Py_CLEAR(self->decoder);
|
||||
if (self->buf)
|
||||
PyMem_Free(self->buf);
|
||||
Py_CLEAR(self->dict);
|
||||
if (self->weakreflist != NULL)
|
||||
PyObject_ClearWeakRefs((PyObject *) self);
|
||||
Py_TYPE(self)->tp_free(self);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue