Fix T63816: Crash opening file with multiple view layers

Dependency graph will not be crated for view layers which were never visible.
This commit is contained in:
Sergey Sharybin
2019-04-23 14:31:21 +02:00
parent 7625fad9e9
commit 5a144c797a

View 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. */