]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988)
authorVictor Stinner <vstinner@python.org>
Fri, 28 Jan 2022 13:08:32 +0000 (14:08 +0100)
committerGitHub <noreply@github.com>
Fri, 28 Jan 2022 13:08:32 +0000 (14:08 +0100)
Objects/structseq.c

index cded877300d9e9c334f0165694330fc34bc5810e..092e1634656a31424559c00b2821eb7124d980cb 100644 (file)
@@ -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