diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-07 09:38:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-07 09:47:17 +0300 |
commit | 11292edba6ec361cc7142c4e2d9af0289cd895bb (patch) | |
tree | 2ecee7643e19d3ae87157d4a4b6c07b2e397f170 /source/blender/blenkernel | |
parent | 1ef59d0eb535c3d526a1a1f72e257b5aa5b15fb3 (diff) |
BMesh: remove BMEditMesh.ob pointer
Remove this pointer since it's linking Mesh data back to the object,
where a single edit-mesh may have multiple object users,
causing incorrect assumptions in the code.
Resolves dangling pointer part of the T72667 crash,
although there are other issues which still need to be fixed.
In EDBM_op_finish and EDBM_update_generic,
full Main lookups have been added which should be replaced with mesh
argument or the update tagging moved elsewhere.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_editmesh.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 3 |
3 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_editmesh.h b/source/blender/blenkernel/BKE_editmesh.h index 7c44428dac8..80cb0f1482b 100644 --- a/source/blender/blenkernel/BKE_editmesh.h +++ b/source/blender/blenkernel/BKE_editmesh.h @@ -35,6 +35,7 @@ struct Depsgraph; struct EditMeshData; struct Mesh; struct MeshStatVis; +struct Object; struct Scene; /** @@ -70,9 +71,6 @@ typedef struct BMEditMesh { short selectmode; short mat_nr; - /* Object this editmesh came from (if it came from one) */ - struct Object *ob; - /*temp variables for x-mirror editing*/ int mirror_cdlayer; /* -1 is invalid */ diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index df4582267b5..f9e7627a8dd 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1839,7 +1839,7 @@ static void editbmesh_build_data(struct Depsgraph *depsgraph, BMEditMesh *em, CustomData_MeshMasks *dataMask) { - BLI_assert(em->ob->id.tag & LIB_TAG_COPIED_ON_WRITE); + BLI_assert(obedit->id.tag & LIB_TAG_COPIED_ON_WRITE); BKE_object_free_derived_caches(obedit); if (DEG_is_active(depsgraph)) { diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 21ca5e6d6a6..366fd0950fa 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -163,9 +163,6 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o BMEditMesh *em = (ob->mode & OB_MODE_EDIT) ? BKE_editmesh_from_object(ob) : NULL; #else BMEditMesh *em = (ob->mode & OB_MODE_EDIT) ? ((Mesh *)ob->data)->edit_mesh : NULL; - if (em && em->ob != ob) { - em = NULL; - } #endif CustomData_MeshMasks cddata_masks = scene->customdata_mask; |