Fix #105715: Freeing the edit-mesh causes future access to fail
The BPyBMesh in `BMesh::py_handle` was invalidated but not cleared, causing future access to return a 'dead' bmesh.
This commit is contained in:
@@ -989,7 +989,11 @@ static PyObject *bpy_bmesh_free(BPy_BMesh *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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user