Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-08-27 04:39:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-27 04:39:51 +0400
commit79f7a78637d4b1691ab1469ee2785d66712c28fb (patch)
tree48cdb159ebaaf962f3649adfac3c9385fef1de49 /source
parent8ef934c73f3baeaa582efb8de906b27a3854979c (diff)
fix [#36528] crash when reinitializing bmesh from mesh
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index e6842051e31..ad11ead29a2 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -1047,6 +1047,8 @@ static PyObject *bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject *
int use_shape_key = false;
int shape_key_index = 0;
+ BPY_BM_CHECK_OBJ(self);
+
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|iii:from_mesh", (char **)kwlist,
&py_mesh, &use_fnorm, &use_shape_key, &shape_key_index) ||
!(me = PyC_RNA_AsPointer(py_mesh, "Mesh")))
@@ -2918,7 +2920,8 @@ static void bpy_bmvert_dealloc(BPy_BMElem *self)
BMesh *bm = self->bm;
if (bm) {
void **ptr = CustomData_bmesh_get(&bm->vdata, self->ele->head.data, CD_BM_ELEM_PYPTR);
- *ptr = NULL;
+ if (ptr)
+ *ptr = NULL;
}
PyObject_DEL(self);
}
@@ -2928,7 +2931,8 @@ static void bpy_bmedge_dealloc(BPy_BMElem *self)
BMesh *bm = self->bm;
if (bm) {
void **ptr = CustomData_bmesh_get(&bm->edata, self->ele->head.data, CD_BM_ELEM_PYPTR);
- *ptr = NULL;
+ if (ptr)
+ *ptr = NULL;
}
PyObject_DEL(self);
}
@@ -2938,7 +2942,8 @@ static void bpy_bmface_dealloc(BPy_BMElem *self)
BMesh *bm = self->bm;
if (bm) {
void **ptr = CustomData_bmesh_get(&bm->pdata, self->ele->head.data, CD_BM_ELEM_PYPTR);
- *ptr = NULL;
+ if (ptr)
+ *ptr = NULL;
}
PyObject_DEL(self);
}
@@ -2948,7 +2953,8 @@ static void bpy_bmloop_dealloc(BPy_BMElem *self)
BMesh *bm = self->bm;
if (bm) {
void **ptr = CustomData_bmesh_get(&bm->ldata, self->ele->head.data, CD_BM_ELEM_PYPTR);
- *ptr = NULL;
+ if (ptr)
+ *ptr = NULL;
}
PyObject_DEL(self);
}