- for (list<Route *>::iterator i = routes.begin(); i != routes.end(); i++) {
- Track *at;
- if ((at = dynamic_cast<Track*>(*i)) != 0) {
- (at->*func)(val, this);
+ for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) {
+ boost::shared_ptr<Track> at;
+
+ if ((at = boost::dynamic_pointer_cast<Track>(*i)) != 0) {
+ (at.get()->*func)(val, group_override);