[Python-checkins] CVS: python/dist/src/Modules _weakref.c,1.7,1.8

Fred L. Drake fdrake@users.sourceforge.net
Thu, 22 Mar 2001 10:05:33 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv25542

Modified Files:
	_weakref.c 
Log Message:

Inform the cycle-detector that the a weakref object no longer needs to be
tracked as soon as it is clear; this can decrease the number of roots for
the cycle detector sooner rather than later in applications which hold on
to weak references beyond the time of the invalidation.


Index: _weakref.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_weakref.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** _weakref.c	2001/02/27 18:36:56	1.7
--- _weakref.c	2001/03/22 18:05:30	1.8
***************
*** 60,63 ****
--- 60,64 ----
          PyWeakReference **list = GET_WEAKREFS_LISTPTR(self->wr_object);
  
+         PyObject_GC_Fini((PyObject *)self);
          if (*list == self)
              *list = self->wr_next;
***************
*** 79,83 ****
  {
      clear_weakref(self);
-     PyObject_GC_Fini((PyObject *)self);
      self->wr_next = free_list;
      free_list = self;
--- 80,83 ----