diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-08 10:36:04 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-08 10:41:12 +0100 |
commit | 24b8004bf74884e5fc4f6c376ba782402712ab49 (patch) | |
tree | 457dad74338748acef4b3e2e5569644eb1900bf5 /libs/ardour/selection.cc | |
parent | 005fa9176a21e5f85ef713bc5af691378cc6824b (diff) |
when removing Stripables from CoreSelection by ID, be sure to remove all possible entries in the Selection
A Stripable may have itself plus zero-to-N automation controls in
CoreSelection.
Diffstat (limited to 'libs/ardour/selection.cc')
-rw-r--r-- | libs/ardour/selection.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/ardour/selection.cc b/libs/ardour/selection.cc index 876056c3da..6775759fc9 100644 --- a/libs/ardour/selection.cc +++ b/libs/ardour/selection.cc @@ -249,10 +249,14 @@ CoreSelection::remove_stripable_by_id (PBD::ID const & id) { Glib::Threads::RWLock::WriterLock lm (_lock); - for (SelectedStripables::iterator x = _stripables.begin(); x != _stripables.end(); ++x) { + for (SelectedStripables::iterator x = _stripables.begin(); x != _stripables.end(); ) { if ((*x).stripable == id) { - _stripables.erase (x); - return; + x = _stripables.erase (x); + /* keep going because there may be more than 1 pair of + stripable/automation-control in the selection. + */ + } else { + ++x; } } } |