summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2009-09-29 05:30:42 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2009-09-29 05:30:42 (GMT)
commit4c9c260c1a8222d5ecb060e4535910c8cfde0dbd (patch)
treee3737dbe6ac85159f37631bd8ec1649ac7bbbf63 /Modules
parentb4dc921e30cd6c7735baaa49c6843dcd47ae7fd5 (diff)
downloadcpython-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.c2
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);
}