Fix T70247 Crash on enter edit mode with UV editor opened
authorClément Foucault <foucault.clem@gmail.com>
Fri, 27 Sep 2019 17:45:19 +0000 (19:45 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 27 Sep 2019 17:45:27 +0000 (19:45 +0200)
source/blender/draw/intern/draw_cache_impl_mesh.c

index 77b9daa959df9e3aebd060dbe6c6089a9613a2cb..6dc2f514f3a403fbdcae5cf757cd91124e4af9ac 100644 (file)
@@ -1031,6 +1031,9 @@ void DRW_mesh_batch_cache_create_requested(
     GPU_BATCH_CLEAR_SAFE(cache->batch.edit_triangles);
     GPU_BATCH_CLEAR_SAFE(cache->batch.edit_lnor);
     GPU_BATCH_CLEAR_SAFE(cache->batch.edit_selection_faces);
+    for (int i = 0; i < cache->mat_len; i++) {
+      GPU_BATCH_CLEAR_SAFE(cache->surface_per_mat[i]);
+    }
 
     cache->batch_ready &= ~(MBC_SURFACE | MBC_SURFACE_WEIGHTS | MBC_EDIT_MESH_ANALYSIS |
                             MBC_EDIT_TRIANGLES | MBC_EDIT_LNOR | MBC_EDIT_SELECTION_FACES);