diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index af439d7711..7cea903d5d 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -3319,11 +3319,17 @@ void Playlist::fade_range (list& ranges) { RegionReadLock rlock (this); - for (list::iterator r = ranges.begin(); r != ranges.end(); ++r) { - for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) { - (*i)->fade_range ((*r).start, (*r).end); - } - } + for (list::iterator r = ranges.begin(); r != ranges.end(); ) { + list::iterator tmpr = r; + ++tmpr; + for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ) { + RegionList::const_iterator tmpi = i; + ++tmpi; + (*i)->fade_range ((*r).start, (*r).end); + i = tmpi; + } + r = tmpr; + } } uint32_t