diff options
author | Philip Jenvey <pjenvey@underboss.org> | 2009-09-29 04:32:44 (GMT) |
---|---|---|
committer | Philip Jenvey <pjenvey@underboss.org> | 2009-09-29 04:32:44 (GMT) |
commit | dbf3b258e72adcee2c2ef1bbc9ea5ef5ec78a41e (patch) | |
tree | ebd384a9699f08439548e5c96a54a6545184bb0f /Modules | |
parent | b93fff0a57cf9a39c47d29ec8011bd2b14b506ac (diff) | |
download | cpython-dbf3b258e72adcee2c2ef1bbc9ea5ef5ec78a41e.zip cpython-dbf3b258e72adcee2c2ef1bbc9ea5ef5ec78a41e.tar.gz cpython-dbf3b258e72adcee2c2ef1bbc9ea5ef5ec78a41e.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
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 ad84a1e..f6d7ee4 100644 --- a/Modules/threadmodule.c +++ b/Modules/threadmodule.c @@ -244,7 +244,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); @@ -266,6 +265,7 @@ local_dealloc(localobject *self) PyDict_DelItem(tstate->dict, self->key); } + Py_XDECREF(self->key); local_clear(self); Py_TYPE(self)->tp_free((PyObject*)self); } |