Skip to content

Commit

Permalink
fix: call 'PyObject_ClearWeakRefs' unconditionally
Browse files Browse the repository at this point in the history
Toward #323.
  • Loading branch information
tseaver committed Sep 5, 2024
1 parent 6ffccef commit 334d432
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/zope/interface/_zope_interface_coptimizations.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,8 @@ static void
SB_dealloc(SB* self)
{
PyObject_GC_UnTrack((PyObject*)self);
PyObject_ClearWeakRefs(OBJECT(self));
PyTypeObject* tp = Py_TYPE(self);
#if USE_EXPLICIT_WEAKREFLIST
if (self->weakreflist != NULL) {
PyObject_ClearWeakRefs(OBJECT(self));
}
#endif
SB_clear(self);
tp->tp_free(OBJECT(self));
#if USE_HEAP_TYPES
Expand Down Expand Up @@ -569,8 +565,7 @@ CPB_clear(CPB* self)
{
Py_CLEAR(self->_cls);
Py_CLEAR(self->_implements);
SB_clear((SB*)self);
return 0;
return SB_clear((SB*)self);
}

static void
Expand Down

0 comments on commit 334d432

Please sign in to comment.