Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions atom/src/eventbinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ EventBinder_traverse( EventBinder* self, visitproc visit, void* arg )
{
Py_VISIT( self->member );
Py_VISIT( self->atom );
#if PY_VERSION_HEX >= 0x03090000
// This was not needed before Python 3.9 (Python issue 35810 and 40217)
Py_VISIT(Py_TYPE(self));
#endif
return 0;
}

Expand All @@ -52,7 +49,11 @@ EventBinder_dealloc( EventBinder* self )
if( numfree < FREELIST_MAX )
freelist[ numfree++ ] = self;
else
Py_TYPE(self)->tp_free( pyobject_cast( self ) );
{
PyTypeObject* tp = Py_TYPE( self );
tp->tp_free( pyobject_cast( self ) );
Py_DECREF( tp );
}
}


Expand Down Expand Up @@ -168,6 +169,7 @@ EventBinder::New( Member* member, CAtom* atom )
{
pybinder = pyobject_cast( freelist[ --numfree ] );
_Py_NewReference( pybinder );
PyObject_GC_Track( pybinder );
}
else
{
Expand Down
Loading