main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 19565469c8 - Show all commits

View File

@ -378,6 +378,8 @@ typedef struct BMesh {
* This allows save invalidation of a #BMesh when it's freed, * This allows save invalidation of a #BMesh when it's freed,
* so the Python object will report it as having been removed, * so the Python object will report it as having been removed,
* instead of crashing on invalid memory access. * instead of crashing on invalid memory access.
*
* Doesn't hold a #PyObject reference, cleared when the last object is de-referenced.
*/ */
void *py_handle; void *py_handle;
} BMesh; } BMesh;

View File

@ -989,7 +989,11 @@ static PyObject *bpy_bmesh_free(BPy_BMesh *self)
bm_dealloc_editmode_warn(self); bm_dealloc_editmode_warn(self);
if ((self->flag & BPY_BMFLAG_IS_WRAPPED) == 0) { if (self->flag & BPY_BMFLAG_IS_WRAPPED) {
/* Ensure further access doesn't return this invalid object, see: #105715. */
bm->py_handle = NULL;
}
else {
BM_mesh_free(bm); BM_mesh_free(bm);
} }