Skip to content

Commit 6ba212b

Browse files
authored
Fix process of reference count during GC
call PyObject_GC_UnTrack() in tp_dealloc() see the following sites for details: * https://bugs.python.org/issue31095 * python/cpython#2974
1 parent fc5414c commit 6ba212b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/zope/interface/_zope_interface_coptimizations.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ lookup_traverse(lookup *self, visitproc visit, void *arg)
759759

760760
static int
761761
lookup_clear(lookup *self)
762-
{
762+
{
763763
Py_CLEAR(self->_cache);
764764
Py_CLEAR(self->_mcache);
765765
Py_CLEAR(self->_scache);
@@ -769,6 +769,7 @@ lookup_clear(lookup *self)
769769
static void
770770
lookup_dealloc(lookup *self)
771771
{
772+
PyObject_GC_UnTrack((PyObject *)self);
772773
lookup_clear(self);
773774
Py_TYPE(self)->tp_free((PyObject*)self);
774775
}
@@ -1335,6 +1336,7 @@ verifying_clear(verify *self)
13351336
static void
13361337
verifying_dealloc(verify *self)
13371338
{
1339+
PyObject_GC_UnTrack((PyObject *)self);
13381340
verifying_clear(self);
13391341
Py_TYPE(self)->tp_free((PyObject*)self);
13401342
}

0 commit comments

Comments
 (0)