[Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.36,2.37

Guido van Rossum gvanrossum@users.sourceforge.net
Thu, 28 Mar 2002 12:35:00 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv13618/Modules

Modified Files:
	gcmodule.c 
Log Message:
This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).

The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.

BUGFIX CANDIDATE!


Index: gcmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v
retrieving revision 2.36
retrieving revision 2.37
diff -C2 -d -r2.36 -r2.37
*** gcmodule.c	22 Mar 2002 15:41:03 -0000	2.36
--- gcmodule.c	28 Mar 2002 20:34:58 -0000	2.37
***************
*** 820,824 ****
  _PyObject_GC_UnTrack(PyObject *op)
  {
! 	_PyObject_GC_UNTRACK(op);
  }
  
--- 820,826 ----
  _PyObject_GC_UnTrack(PyObject *op)
  {
! 	PyGC_Head *gc = AS_GC(op);
! 	if (gc->gc.gc_next != NULL)
! 		_PyObject_GC_UNTRACK(op);
  }