Gui: prevent DAGView crash freecad when a document gets a circular dependency

This commit is contained in:
Alexander Golubev 2015-08-07 15:53:28 +03:00 committed by Stefan Tröger
parent 2fc5d6c818
commit 37320a0bfa

View File

@ -527,7 +527,15 @@ void Model::updateSlot()
indexVerticesEdges(); indexVerticesEdges();
Path sorted; Path sorted;
try {
// this sort gives the execute
boost::topological_sort(*theGraph, std::back_inserter(sorted)); boost::topological_sort(*theGraph, std::back_inserter(sorted));
}
catch (const std::exception& e) {
std::cerr << "Document::recompute: " << e.what() << std::endl;
return;
}
//index the vertices in sort order. //index the vertices in sort order.
int tempIndex = 0; int tempIndex = 0;
for (const auto &currentVertex : sorted) for (const auto &currentVertex : sorted)