Fix T63816: Crash opening file with multiple view layers
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 23 Apr 2019 12:31:21 +0000 (14:31 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 23 Apr 2019 12:31:21 +0000 (14:31 +0200)
Dependency graph will not be crated for view layers which were never visible.

source/blender/draw/intern/draw_manager.c

index 984b524..fc66d52 100644 (file)
@@ -986,6 +986,9 @@ void DRW_cache_free_old_batches(Main *bmain)
   for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
     for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) {
       Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, false);
+      if (depsgraph == NULL) {
+        continue;
+      }
 
       /* TODO(fclem): This is not optimal since it iter over all dupli instances.
        * In this case only the source object should be tagged. */