diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 083437bd9..5ccde012e 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1090,24 +1090,25 @@ std::vector Document::getInList(const DocumentObject* me) return result; } - -void Document::_rebuildDependencyList(void){ - +void Document::_rebuildDependencyList(void) +{ + d->VertexObjectList.clear(); + d->DepList.clear(); // Filling up the adjacency List - for (std::map::const_iterator It = d->objectMap.begin(); It != d->objectMap.end();++It) + for (std::map::const_iterator It = d->objectMap.begin(); It != d->objectMap.end();++It) { // add the object as Vertex and remember the index d->VertexObjectList[It->second] = add_vertex(d->DepList); + } // add the edges for (std::map::const_iterator It = d->objectMap.begin(); It != d->objectMap.end();++It) { std::vector OutList = It->second->getOutList(); - for (std::vector::const_iterator It2=OutList.begin();It2!=OutList.end();++It2) + for (std::vector::const_iterator It2=OutList.begin();It2!=OutList.end();++It2) { if (*It2) add_edge(d->VertexObjectList[It->second],d->VertexObjectList[*It2],d->DepList); + } } - } - void Document::recompute() { // delete recompute log @@ -1115,7 +1116,7 @@ void Document::recompute() delete *it; _RecomputeLog.clear(); - // updates the depency graph + // updates the dependency graph _rebuildDependencyList(); //DependencyList DepList;