From 07a959067d5a3c05fcbd65105525d6e139be5c5f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Jan 2020 22:20:45 +1100 Subject: Fix T72667: Collection delete hierarchy in edit-mode crashes Also resolves T72848, although updating multiple windows doesn't work, this matches 2.7x behavior. --- source/blender/draw/intern/draw_cache_extract_mesh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.c') diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c index cce1710423b..e43c45a953d 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh.c @@ -128,6 +128,7 @@ typedef struct MeshRenderData { } MeshRenderData; static MeshRenderData *mesh_render_data_create(Mesh *me, + const bool is_editmode, const float obmat[4][4], const bool do_final, const bool do_uvedit, @@ -145,7 +146,7 @@ static MeshRenderData *mesh_render_data_create(Mesh *me, const bool is_auto_smooth = (me->flag & ME_AUTOSMOOTH) != 0; const float split_angle = is_auto_smooth ? me->smoothresh : (float)M_PI; - if (me->edit_mesh) { + if (is_editmode) { BLI_assert(me->edit_mesh->mesh_eval_cage && me->edit_mesh->mesh_eval_final); mr->bm = me->edit_mesh->bm; mr->edit_bmesh = me->edit_mesh; @@ -4378,6 +4379,7 @@ static void extract_task_create(TaskPool *task_pool, void mesh_buffer_cache_create_requested(MeshBatchCache *cache, MeshBufferCache mbc, Mesh *me, + const bool is_editmode, const float obmat[4][4], const bool do_final, const bool do_uvedit, @@ -4439,7 +4441,7 @@ void mesh_buffer_cache_create_requested(MeshBatchCache *cache, #endif MeshRenderData *mr = mesh_render_data_create( - me, obmat, do_final, do_uvedit, iter_flag, data_flag, cd_layer_used, ts); + me, is_editmode, obmat, do_final, do_uvedit, iter_flag, data_flag, cd_layer_used, ts); mr->cache = cache; /* HACK */ mr->use_hide = use_hide; mr->use_subsurf_fdots = use_subsurf_fdots; -- cgit v1.2.3