diff options
author | Guido van Rossum <guido@python.org> | 2002-03-28 20:34:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-03-28 20:34:59 (GMT) |
commit | ff413af605d7aab610272c5668bc870ebcbf56ef (patch) | |
tree | 1a79acab5df1da3a36e5b78c093793f192b2c269 /Modules | |
parent | 31f8483eef19ebf40c7831d79cac270e69a96ce0 (diff) | |
download | cpython-ff413af605d7aab610272c5668bc870ebcbf56ef.zip cpython-ff413af605d7aab610272c5668bc870ebcbf56ef.tar.gz cpython-ff413af605d7aab610272c5668bc870ebcbf56ef.tar.bz2 |
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!
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/gcmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 71e9596..ed25bd4 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -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 * |