From 37320a0bfa0f34b45e46d2212e383a3323e14c1e Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Fri, 7 Aug 2015 15:53:28 +0300 Subject: [PATCH] Gui: prevent DAGView crash freecad when a document gets a circular dependency --- src/Gui/DAGView/DAGModel.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Gui/DAGView/DAGModel.cpp b/src/Gui/DAGView/DAGModel.cpp index 73366047d..6ce5037b4 100644 --- a/src/Gui/DAGView/DAGModel.cpp +++ b/src/Gui/DAGView/DAGModel.cpp @@ -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 ¤tVertex : sorted)