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.
if (self->wr_object != Py_None) {
PyWeakReference **list = GET_WEAKREFS_LISTPTR(self->wr_object);
+ PyObject_GC_Fini((PyObject *)self);
if (*list == self)
*list = self->wr_next;
self->wr_object = Py_None;
weakref_dealloc(PyWeakReference *self)
{
clear_weakref(self);
- PyObject_GC_Fini((PyObject *)self);
self->wr_next = free_list;
free_list = self;
}