Fix T64366 DRW: Crash opening Mr Elephant scene since recent commit
authorClément Foucault <foucault.clem@gmail.com>
Thu, 9 May 2019 09:16:54 +0000 (11:16 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Thu, 9 May 2019 09:16:54 +0000 (11:16 +0200)
source/blender/draw/intern/draw_cache.c

index de20390..e989626 100644 (file)
@@ -3955,6 +3955,7 @@ GPUBatch *DRW_cache_cursor_get(bool crosshair_lines)
 
 void drw_batch_cache_validate(Object *ob)
 {
+  struct Mesh *mesh_eval = ob->runtime.mesh_eval;
   switch (ob->type) {
     case OB_MESH:
       DRW_mesh_batch_cache_validate((Mesh *)ob->data);
@@ -3962,6 +3963,9 @@ void drw_batch_cache_validate(Object *ob)
     case OB_CURVE:
     case OB_FONT:
     case OB_SURF:
+      if (mesh_eval != NULL) {
+        DRW_mesh_batch_cache_validate(mesh_eval);
+      }
       DRW_curve_batch_cache_validate((Curve *)ob->data);
       break;
     case OB_MBALL: