13
0

Fix crash in Editor::sync_order_keys() when a route is removed.

git-svn-id: svn://localhost/ardour2/trunk@2597 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2007-11-06 12:53:04 +00:00
parent 95c0c53ab9
commit 6c923d7f60

View File

@ -162,7 +162,7 @@ Editor::remove_route (TimeAxisView *tv)
TrackViewList::iterator i = find (track_views.begin(), track_views.end(), tv); TrackViewList::iterator i = find (track_views.begin(), track_views.end(), tv);
/* set up `nearby' to be a suitable nearby track to select once /* set up `nearby' to be a suitable nearby track to select once
this one has gong */ this one has gone */
TrackViewList::iterator nearby = track_views.end (); TrackViewList::iterator nearby = track_views.end ();
if (i != track_views.end()) { if (i != track_views.end()) {
@ -191,6 +191,14 @@ Editor::remove_route (TimeAxisView *tv)
} }
} }
/* Decrement old order keys for tracks `above' the one that is being removed */
for (ri = rows.begin(); ri != rows.end(); ++ri) {
TimeAxisView* v = (*ri)[route_display_columns.tv];
if (v->old_order_key() > tv->old_order_key()) {
v->set_old_order_key (v->old_order_key() - 1);
}
}
for (ri = rows.begin(); ri != rows.end(); ++ri) { for (ri = rows.begin(); ri != rows.end(); ++ri) {
if ((*ri)[route_display_columns.tv] == tv) { if ((*ri)[route_display_columns.tv] == tv) {
route_display_model->erase (ri); route_display_model->erase (ri);