◐ Shell
clean mode source ↗

[3.9] gh-92036: Fix gc_fini_untrack() (GH-92037) by miss-islington · Pull Request #92297 · python/cpython

@vstinner @miss-islington

Fix a crash in subinterpreters related to the garbage collector. When
a subinterpreter is deleted, untrack all objects tracked by its GC.
To prevent a crash in deallocator functions expecting objects to be
tracked by the GC, leak a strong reference to these objects on
purpose, so they are never deleted and their deallocator functions
are not called.
(cherry picked from commit 1424336)

Co-authored-by: Victor Stinner <vstinner@python.org>