diff options
Diffstat (limited to 'Objects/structseq.c')
| -rw-r--r-- | Objects/structseq.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c index cf36fa7f97..a5046c42cb 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -63,12 +63,17 @@ static void structseq_dealloc(PyStructSequence *obj) { Py_ssize_t i, size; + PyTypeObject *tp; + tp = (PyTypeObject *) Py_TYPE(obj); size = REAL_SIZE(obj); for (i = 0; i < size; ++i) { Py_XDECREF(obj->ob_item[i]); } PyObject_GC_Del(obj); + if (PyType_GetFlags(tp) & Py_TPFLAGS_HEAPTYPE) { + Py_DECREF(tp); + } } /*[clinic input] |
