diff options
author | Philip Jenvey <pjenvey@underboss.org> | 2009-09-29 05:30:42 (GMT) |
---|---|---|
committer | Philip Jenvey <pjenvey@underboss.org> | 2009-09-29 05:30:42 (GMT) |
commit | 4c9c260c1a8222d5ecb060e4535910c8cfde0dbd (patch) | |
tree | e3737dbe6ac85159f37631bd8ec1649ac7bbbf63 /Modules | |
parent | b4dc921e30cd6c7735baaa49c6843dcd47ae7fd5 (diff) | |
download | cpython-4c9c260c1a8222d5ecb060e4535910c8cfde0dbd.zip cpython-4c9c260c1a8222d5ecb060e4535910c8cfde0dbd.tar.gz cpython-4c9c260c1a8222d5ecb060e4535910c8cfde0dbd.tar.bz2 |
#6990: clear threading.local's key only after its thread state is removed:
fixes local subclasses leaving old state around after a ref cycle GC which
could be recycled by new locals
(backported from r75123)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/threadmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c index 2726045..c1df6c1 100644 --- a/Modules/threadmodule.c +++ b/Modules/threadmodule.c @@ -228,7 +228,6 @@ local_traverse(localobject *self, visitproc visit, void *arg) static int local_clear(localobject *self) { - Py_CLEAR(self->key); Py_CLEAR(self->args); Py_CLEAR(self->kw); Py_CLEAR(self->dict); @@ -250,6 +249,7 @@ local_dealloc(localobject *self) PyDict_DelItem(tstate->dict, self->key); } + Py_XDECREF(self->key); local_clear(self); self->ob_type->tp_free((PyObject*)self); } |