Fix logic for calling PyObject_GC_UnTrack

All tracked objects need a matching un-track,
also remove redundant Py_XDECREF call.
This commit is contained in:
2021-03-04 15:06:15 +11:00
parent 0d28e2a334
commit a40ccde405
3 changed files with 4 additions and 7 deletions

View File

@@ -203,10 +203,8 @@ static const EnumPropertyItem property_subtype_array_items[] = {
static void bpy_prop_deferred_dealloc(BPy_PropDeferred *self)
{
if (self->kw) {
PyObject_GC_UnTrack(self);
Py_CLEAR(self->kw);
}
PyObject_GC_UnTrack(self);
Py_CLEAR(self->kw);
PyObject_GC_Del(self);
}