diff options
Diffstat (limited to 'Objects/odictobject.c')
-rw-r--r-- | Objects/odictobject.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 1412acb50ac..02fcbbaa0d4 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -473,6 +473,7 @@ later: #include "pycore_pyerrors.h" // _PyErr_ChainExceptions1() #include "pycore_tuple.h" // _PyTuple_Recycle() #include <stddef.h> // offsetof() +#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS() #include "clinic/odictobject.c.h" @@ -1389,16 +1390,12 @@ odict_dealloc(PyObject *op) { PyODictObject *self = _PyODictObject_CAST(op); PyObject_GC_UnTrack(self); - Py_TRASHCAN_BEGIN(self, odict_dealloc) Py_XDECREF(self->od_inst_dict); - if (self->od_weakreflist != NULL) - PyObject_ClearWeakRefs((PyObject *)self); + FT_CLEAR_WEAKREFS(op, self->od_weakreflist); _odict_clear_nodes(self); PyDict_Type.tp_dealloc((PyObject *)self); - - Py_TRASHCAN_END } /* tp_repr */ |