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

@ -139,8 +139,8 @@ tupledealloc(register PyTupleObject *op)
{
register int i;
register int len = op->ob_size;
PyObject_GC_UnTrack(op);
Py_TRASHCAN_SAFE_BEGIN(op)
_PyObject_GC_UNTRACK(op);
if (len > 0) {
i = len;
while (--i >= 0)