bpo-46417: _PyStructSequence_FiniType() updates _Py_RefTotal (GH-30988)

This commit is contained in:
Victor Stinner 2022-01-28 14:08:32 +01:00 committed by GitHub
parent 89fd7c3452
commit 9a24127113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View 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