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

This commit is contained in:
Alexander Golubev
2016-04-12 18:12:16 +02:00
committed by Stefan Tröger
parent 2fc5d6c818
commit 37320a0bfa
+9 -1
View File
@@ -527,7 +527,15 @@ void Model::updateSlot()
indexVerticesEdges();
Path sorted;
boost::topological_sort(*theGraph, std::back_inserter(sorted));
try {
// this sort gives the execute
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.
int tempIndex = 0;
for (const auto &currentVertex : sorted)