Merge branch 'blender-v4.1-release'

This commit is contained in:
Campbell Barton 2024-03-12 16:39:59 +11:00
commit 5fd64db1cf
1 changed files with 8 additions and 0 deletions

View File

@ -1173,6 +1173,14 @@ static void pyrna_struct_dealloc(BPy_StructRNA *self)
PyObject_GC_UnTrack(self);
pyrna_struct_clear(self);
}
else {
PyTypeObject *base = Py_TYPE(self)->tp_base;
/* Python temporarily tracks these types when freeing, see Python bug 26617. */
if (base && PyType_IS_GC(base)) {
PyObject_GC_UnTrack(self);
}
BLI_assert(!PyObject_GC_IsTracked((PyObject *)self));
}
#endif /* !USE_PYRNA_STRUCT_REFERENCE */
/* NOTE: for subclassed PyObjects calling PyObject_DEL() directly crashes. */