Return 0 from the topological sort if it failed due to
feedback. git-svn-id: svn://localhost/ardour2/branches/3.0@10509 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9a734cd4b8
commit
0ed06420c2
@ -146,7 +146,9 @@ struct RouteRecEnabledComparator
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Perform a topological sort of a list of routes using a directed graph representing connections.
|
||||||
|
* @return Sorted list of routes, or 0 if the graph contains cycles (feedback loops).
|
||||||
|
*/
|
||||||
boost::shared_ptr<RouteList>
|
boost::shared_ptr<RouteList>
|
||||||
ARDOUR::topological_sort (
|
ARDOUR::topological_sort (
|
||||||
boost::shared_ptr<RouteList> routes,
|
boost::shared_ptr<RouteList> routes,
|
||||||
@ -189,7 +191,8 @@ ARDOUR::topological_sort (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!edges.empty ()) {
|
if (!edges.empty ()) {
|
||||||
cout << "Feedback detected.\n";
|
/* There are cycles in the graph, so we can't do a topological sort */
|
||||||
|
return boost::shared_ptr<RouteList> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return sorted_routes;
|
return sorted_routes;
|
||||||
|
Loading…
Reference in New Issue
Block a user