diff Objects/typeobject.c @ 24186:bec5b6610622 2.2

Attempting to resurrect a dying instance of a new-style class in a __del__ method died with Fatal Python error: GC object already in linked list in both release and debug builds. Fixed that. Added a new test that dies without the fix.
author Tim Peters <tim.peters@gmail.com>
date Thu, 11 Jul 2002 07:06:44 +0000
parents e2fa741c547f
children 7d0982056f72
line wrap: on
line diff
--- a/Objects/typeobject.c	Wed Jul 10 19:21:55 2002 +0000
+++ b/Objects/typeobject.c	Thu Jul 11 07:06:44 2002 +0000
@@ -403,7 +403,8 @@
 #ifdef COUNT_ALLOCS
 		self->ob_type->tp_frees--;
 #endif
-		_PyObject_GC_TRACK(self);
+		/* This should still be a tracked gc'ed object. */
+		assert(((PyGC_Head *)(self)-1)->gc.gc_next != NULL);
 		return -1; /* __del__ added a reference; don't delete now */
 	}
 #ifdef Py_TRACE_REFS