# HG changeset patch # User Chris Cannam # Date 1564761020 -3600 # Node ID 7669c8cc869deb4ca0114a577a518913bd5e2da2 # Parent 46ab91e26bfe2a9364400310470355015a01e331 Use layer->getSourceModel diff -r 46ab91e26bfe -r 7669c8cc869d framework/Document.cpp --- a/framework/Document.cpp Thu Aug 01 15:21:13 2019 +0100 +++ b/framework/Document.cpp Fri Aug 02 16:50:20 2019 +0100 @@ -1356,12 +1356,9 @@ if (i->first && !i->second.empty()) { // Layer exists, is in views ModelId modelId = i->first->getModel(); - if (auto model = ModelById::get(modelId)) { - used.insert(modelId); - if (!model->getSourceModel().isNone()) { - used.insert(model->getSourceModel()); - } - } + ModelId sourceId = i->first->getSourceModel(); + if (!modelId.isNone()) used.insert(modelId); + if (!sourceId.isNone()) used.insert(sourceId); } }