]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport to 2.2.1:
authorGuido van Rossum <guido@python.org>
Fri, 29 Mar 2002 14:47:18 +0000 (14:47 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 29 Mar 2002 14:47:18 +0000 (14:47 +0000)
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!

Python/traceback.c

index fee9d12a00e482e4e4d073ee5fe71c325388be44..c1c2c16ac13674da9ab92f4dc70e199ab33ee98b 100644 (file)
@@ -35,8 +35,8 @@ tb_getattr(tracebackobject *tb, char *name)
 static void
 tb_dealloc(tracebackobject *tb)
 {
+       PyObject_GC_UnTrack(tb);
        Py_TRASHCAN_SAFE_BEGIN(tb)
-       _PyObject_GC_UNTRACK(tb);
        Py_XDECREF(tb->tb_next);
        Py_XDECREF(tb->tb_frame);
        PyObject_GC_Del(tb);