diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-10-30 23:09:22 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-10-30 23:09:22 (GMT) |
commit | ead8b7ab3008bda9b6a50d6d9d02ed68dab3b0fd (patch) | |
tree | 88d586b297a7587ee6face7b687b8a0008a2c3c1 /Objects | |
parent | d7bcf4deb174e5e5b6548eb64fe2b0735da5dc95 (diff) | |
download | cpython-ead8b7ab3008bda9b6a50d6d9d02ed68dab3b0fd.zip cpython-ead8b7ab3008bda9b6a50d6d9d02ed68dab3b0fd.tar.gz cpython-ead8b7ab3008bda9b6a50d6d9d02ed68dab3b0fd.tar.bz2 |
SF 1055820: weakref callback vs gc vs threads
In cyclic gc, clear weakrefs to unreachable objects before allowing any
Python code (weakref callbacks or __del__ methods) to run.
This is a critical bugfix, affecting all versions of Python since weakrefs
were introduced. I'll backport to 2.3.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/weakrefobject.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index 6da8192..02370c4 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -850,7 +850,9 @@ PyWeakref_GetObject(PyObject *ref) return PyWeakref_GET_OBJECT(ref); } - +/* Note that there's an inlined copy-paste of handle_callback() in gcmodule.c's + * handle_weakrefs(). + */ static void handle_callback(PyWeakReference *ref, PyObject *callback) { |