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!
This commit is contained in:
Guido van Rossum 2002-03-28 20:34:59 +00:00
parent 31f8483eef
commit ff413af605
5 changed files with 7 additions and 5 deletions

View file

@ -819,7 +819,9 @@ _PyObject_GC_Track(PyObject *op)
void
_PyObject_GC_UnTrack(PyObject *op)
{
_PyObject_GC_UNTRACK(op);
PyGC_Head *gc = AS_GC(op);
if (gc->gc.gc_next != NULL)
_PyObject_GC_UNTRACK(op);
}
PyObject *