Fix edit-mesh select crash when using face-dots
The GPUVertBuf was freed but not the GPUBatch.
Old bug exposed by new code from 8a6414ed46.
This commit is contained in:
@@ -2214,9 +2214,11 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, int mode)
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_vertices);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_edges);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_facedots);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_selection_facedots);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_mesh_analysis);
|
||||
cache->batch_ready &= ~(MBC_EDIT_TRIANGLES | MBC_EDIT_VERTICES | MBC_EDIT_EDGES |
|
||||
MBC_EDIT_FACEDOTS | MBC_EDIT_MESH_ANALYSIS);
|
||||
MBC_EDIT_FACEDOTS | MBC_EDIT_SELECTION_FACEDOTS |
|
||||
MBC_EDIT_MESH_ANALYSIS);
|
||||
/* Because visible UVs depends on edit mode selection, discard everything. */
|
||||
mesh_batch_cache_discard_uvedit(cache);
|
||||
break;
|
||||
|
||||
@@ -2801,7 +2801,7 @@ void DRW_draw_select_id_object(Scene *scene,
|
||||
if (select_mode & SCE_SELECT_VERTEX) {
|
||||
geom_verts = DRW_mesh_batch_cache_get_verts_with_select_id(me);
|
||||
}
|
||||
if (draw_facedot) {
|
||||
if (use_faceselect && draw_facedot) {
|
||||
geom_facedots = DRW_mesh_batch_cache_get_facedots_with_select_id(me);
|
||||
}
|
||||
DRW_mesh_batch_cache_create_requested(ob, me, NULL, false, true);
|
||||
|
||||
Reference in New Issue
Block a user