[3.10] bpo-44184: Fix subtype_dealloc() for freed type (GH-26274) by miss-islington · Pull Request #26290 · python/cpython
Fix a crash at Python exit when a deallocator function removes the
last strong reference to a heap type.
Don't read type memory after calling basedealloc() since
basedealloc() can deallocate the type and free its memory.
_PyMem_IsPtrFreed() argument is now constant.
(cherry picked from commit 615069e)
Co-authored-by: Victor Stinner vstinner@python.org