Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reduce diff
  • Loading branch information
picnixz committed Jan 20, 2025
commit cf4414173930baffb7e258e8cbeaee81ae51690b
2 changes: 1 addition & 1 deletion Modules/_io/bufferedio.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ buffered_dealloc(PyObject *op)
self->lock = NULL;
}
(void)buffered_clear(op);
tp->tp_free(op);
tp->tp_free(self);
Py_DECREF(tp);
}

Expand Down
2 changes: 1 addition & 1 deletion Modules/_io/bytesio.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ bytesio_dealloc(PyObject *op)
{
bytesio *self = _bytesio_CAST(op);
PyTypeObject *tp = Py_TYPE(self);
_PyObject_GC_UNTRACK(op);
_PyObject_GC_UNTRACK(self);
if (self->exports > 0) {
PyErr_SetString(PyExc_SystemError,
"deallocated BytesIO object has exported buffers");
Expand Down
12 changes: 6 additions & 6 deletions Modules/_io/iobase.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,15 +362,15 @@ iobase_clear(PyObject *op)
/* Destructor */

static void
iobase_dealloc(PyObject *self)
iobase_dealloc(PyObject *op)
{
/* NOTE: since IOBaseObject has its own dict, Python-defined attributes
are still available here for close() to use.
However, if the derived class declares a __slots__, those slots are
already gone.
*/
iobase *base = _iobase_CAST(self);
if (_PyIOBase_finalize(self) < 0) {
iobase *self = _iobase_CAST(op);
if (_PyIOBase_finalize(op) < 0) {
/* When called from a heap type's dealloc, the type will be
decref'ed on return (see e.g. subtype_dealloc in typeobject.c). */
if (_PyType_HasFeature(Py_TYPE(self), Py_TPFLAGS_HEAPTYPE)) {
Expand All @@ -380,9 +380,9 @@ iobase_dealloc(PyObject *self)
}
PyTypeObject *tp = Py_TYPE(self);
_PyObject_GC_UNTRACK(self);
if (base->weakreflist != NULL)
PyObject_ClearWeakRefs(self);
Py_CLEAR(base->dict);
if (self->weakreflist != NULL)
PyObject_ClearWeakRefs(op);
Py_CLEAR(self->dict);
tp->tp_free(self);
Py_DECREF(tp);
}
Expand Down