summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2009-09-29 04:32:44 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2009-09-29 04:32:44 (GMT)
commitdbf3b258e72adcee2c2ef1bbc9ea5ef5ec78a41e (patch)
treeebd384a9699f08439548e5c96a54a6545184bb0f /Modules
parentb93fff0a57cf9a39c47d29ec8011bd2b14b506ac (diff)
downloadcpython-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.c2
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);
}