[Python-checkins] python/dist/src/Objects weakrefobject.c, 1.19, 1.20

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Oct 31 01:09:25 CEST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22636/Objects

Modified Files:
	weakrefobject.c 
Log Message:
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.


Index: weakrefobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- weakrefobject.c	3 Aug 2004 14:47:25 -0000	1.19
+++ weakrefobject.c	30 Oct 2004 23:09:22 -0000	1.20
@@ -850,7 +850,9 @@
     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)
 {



More information about the Python-checkins mailing list