]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-144054: shutdown fix for deferred ref counting (GH-144055)
authorNeil Schemenauer <nas-github@arctrix.com>
Tue, 20 Jan 2026 13:45:12 +0000 (05:45 -0800)
committerGitHub <noreply@github.com>
Tue, 20 Jan 2026 13:45:12 +0000 (14:45 +0100)
commit795d5c5b44c5ac4b7d1619800f341ec2d0332430
treea8b99a9fe42e5ea8739b109ff467212f5e632b02
parent31c81ab0a2fb7009a76426617991a9b539ab0180
gh-144054: shutdown fix for deferred ref counting (GH-144055)

When shutting down, disable deferred refcounting for all GC objects. It
is important to do this also for untracked objects, which before this
change were getting missed.

Small code cleanup:
We can remove the shutdown case disable_deferred_refcounting() call
inside scan_heap_visitor() if we are careful about it.  The key is
that frame_disable_deferred_refcounting() might fail if the object
is untracked.
Python/gc_free_threading.c