summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-02-21 19:11:14 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-02-21 19:11:14 +0100
commit2926555e295ea39904a0127d776a5c5b1531141f (patch)
tree5cb9dc2b65e3bfcbe7b68bfa1f6aa0c5d6d97685 /gtk2_ardour
parentdb7cf8ef1443e102e05d3ac99e9f8f4167c18286 (diff)
fix crash when removing a TimeAxisView from the selection
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/selection.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc
index 298889e329..6ed7a10434 100644
--- a/gtk2_ardour/selection.cc
+++ b/gtk2_ardour/selection.cc
@@ -648,8 +648,14 @@ Selection::remove (TimeAxisView* track)
{
list<TimeAxisView*>::iterator i;
if ((i = find (tracks.begin(), tracks.end(), track)) != tracks.end()) {
- track->set_selected (false);
+ /* erase first, because set_selected() will remove the track
+ from the selection, invalidating the iterator.
+
+ In fact, we don't really even need to do the erase, but this is
+ a hangover of axis view selection being in the GUI.
+ */
tracks.erase (i);
+ track->set_selected (false);
}
}