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

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


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

Modified Files:
      Tag: release22-maint
	gcmodule.c 
Log Message:
Backport to 2.2.1:

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.33.6.1
retrieving revision 2.33.6.2
diff -C2 -d -r2.33.6.1 -r2.33.6.2
*** gcmodule.c	6 Feb 2002 17:06:02 -0000	2.33.6.1
--- gcmodule.c	28 Mar 2002 20:36:49 -0000	2.33.6.2
***************
*** 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);
  }