Skip to content

Commit 0381b45

Browse files
authoredApr 12, 2023
Fix deallocation (hopefully)
1 parent 0dcfcef commit 0381b45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎Modules/_collectionsmodule.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ defdict_dealloc(defdictobject *dd)
20672067
PyTypeObject *tp = Py_TYPE(dd);
20682068
PyObject_GC_UnTrack(dd);
20692069
Py_CLEAR(dd->default_factory);
2070-
tp->tp_free(dd);
2070+
PyDict_Type.tp_dealloc((PyObject *)dd);
20712071
Py_DECREF(tp);
20722072
}
20732073

@@ -2154,14 +2154,14 @@ defdict_traverse(PyObject *self, visitproc visit, void *arg)
21542154
{
21552155
Py_VISIT(Py_TYPE(self));
21562156
Py_VISIT(((defdictobject *)self)->default_factory);
2157-
return 0;
2157+
return PyDict_Type.tp_traverse(self, visit, arg);
21582158
}
21592159

21602160
static int
21612161
defdict_tp_clear(defdictobject *dd)
21622162
{
21632163
Py_CLEAR(dd->default_factory);
2164-
return 0;
2164+
return PyDict_Type.tp_clear((PyObject *)dd);
21652165
}
21662166

21672167
static int

0 commit comments

Comments
 (0)