forked from blender/blender
main sync #3
@ -378,6 +378,8 @@ typedef struct BMesh {
|
||||
* This allows save invalidation of a #BMesh when it's freed,
|
||||
* so the Python object will report it as having been removed,
|
||||
* instead of crashing on invalid memory access.
|
||||
*
|
||||
* Doesn't hold a #PyObject reference, cleared when the last object is de-referenced.
|
||||
*/
|
||||
void *py_handle;
|
||||
} BMesh;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user