diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-06-25 08:05:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-25 16:05:06 +0100 |
commit | 86e49a5026ab9f746b87daae2aca81c845b4a5f4 (patch) | |
tree | 15cfa47acaec2014213c64a0cad8e2c22c566519 /Lib/idlelib/util.py | |
parent | 14943829a8dfacdf5fc1ef78bb155c0e2ec874a4 (diff) | |
download | cpython-git-86e49a5026ab9f746b87daae2aca81c845b4a5f4.tar.gz |
[3.10] gh-94207: Fix struct module leak (GH-94239) (GH-94266)
* gh-94207: Fix struct module leak (GH-94239)
Make _struct.Struct a GC type
This fixes a memory leak in the _struct module, where as soon
as a Struct object is stored in the cache, there's a cycle from
the _struct module to the cache to Struct objects to the Struct
type back to the module. If _struct.Struct is not gc-tracked, that
cycle is never collected.
This PR makes _struct.Struct GC-tracked, and adds a regression test.
(cherry picked from commit 6b865349aae47b90f9ef0b98f3fe3720c2f05601)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Diffstat (limited to 'Lib/idlelib/util.py')
0 files changed, 0 insertions, 0 deletions