[Python-checkins] python/dist/src/Objects typeobject.c,2.126.4.18,2.126.4.19

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Thu, 11 Jul 2002 00:06:46 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv414/22/Objects

Modified Files:
      Tag: release22-maint
	typeobject.c 
Log Message:
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.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.126.4.18
retrieving revision 2.126.4.19
diff -C2 -d -r2.126.4.18 -r2.126.4.19
*** typeobject.c	24 Jun 2002 13:25:41 -0000	2.126.4.18
--- typeobject.c	11 Jul 2002 07:06:44 -0000	2.126.4.19
***************
*** 404,408 ****
  		self->ob_type->tp_frees--;
  #endif
! 		_PyObject_GC_TRACK(self);
  		return -1; /* __del__ added a reference; don't delete now */
  	}
--- 404,409 ----
  		self->ob_type->tp_frees--;
  #endif
! 		/* 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 */
  	}