summaryrefslogtreecommitdiff
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-28 14:08:32 +0100
committerGitHub <noreply@github.com>2022-01-28 14:08:32 +0100
commit9a241271139a317597aca71d5971346b2cfe7dbd (patch)
treed20749d2328025cc00ff7b5a36a7d8c69063a70f /Objects/structseq.c
parent89fd7c34520aac493a8784a221366ed04452612b (diff)
downloadcpython-git-9a241271139a317597aca71d5971346b2cfe7dbd.tar.gz
bpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988)
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index cded877300..092e163465 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