From: Victor Stinner Date: Fri, 28 Jan 2022 13:08:32 +0000 (+0100) Subject: bpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988) X-Git-Tag: v3.11.0a5~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a241271139a317597aca71d5971346b2cfe7dbd;p=thirdparty%2FPython%2Fcpython.git bpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988) --- diff --git a/Objects/structseq.c b/Objects/structseq.c index cded877300d9..092e1634656a 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -553,6 +553,9 @@ _PyStructSequence_FiniType(PyTypeObject *type) // Undo Py_INCREF(type) of _PyStructSequence_InitType(). // Don't use Py_DECREF(): static type must not be deallocated Py_SET_REFCNT(type, 0); +#ifdef Py_REF_DEBUG + _Py_RefTotal--; +#endif // Make sure that _PyStructSequence_InitType() will initialize // the type again