fix shared_ptr<Route> management in Mackie support so that deleted routes are destroyed

This commit is contained in:
Paul Davis 2016-05-07 13:35:57 -04:00
parent a232673454
commit 672528baf4
4 changed files with 23 additions and 16 deletions

View file

@ -937,7 +937,7 @@ Surface::map_routes (const vector<boost::shared_ptr<Route> >& routes)
vector<boost::shared_ptr<Route> >::const_iterator r;
Strips::iterator s = strips.begin();
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Mapping %1 routes\n", routes.size()));
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("Mapping %1 routes to %2 strips\n", routes.size(), strips.size()));
for (r = routes.begin(); r != routes.end() && s != strips.end(); ++s) {
@ -953,6 +953,7 @@ Surface::map_routes (const vector<boost::shared_ptr<Route> >& routes)
}
for (; s != strips.end(); ++s) {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("strip %1 being set to null route\n", (*s)->index()));
(*s)->set_route (boost::shared_ptr<Route>());
}
}