Fix crash when trimming MIDI region with automation.

This seems impossible, but it happens.  Reproduction instructions:

1) Click in an empty portion of MIDI track to create a region
2) Add a CC lane
3) Click some points into lane (perhaps unnecessary)
4) Switch lane to linear mode (perhaps unnecessary)
5) Attempt to extend region leftward (with draw tool, but probaby doesn't matter)
6) Boom

Note trimming still doesn't work in this case and something seems deeply broken, but at least it doesn't crash now.

git-svn-id: svn://localhost/ardour2/branches/3.0@13922 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2013-01-20 06:57:52 +00:00
parent bade953de3
commit 022e590429
1 changed files with 11 additions and 6 deletions

View File

@ -1851,12 +1851,17 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
}
}
}
if (_operation == StartTrim) {
_editor->maybe_locate_with_edit_preroll ( _views.begin()->view->region()->position() );
}
if (_operation == EndTrim) {
_editor->maybe_locate_with_edit_preroll ( _views.begin()->view->region()->position() + _views.begin()->view->region()->length() );
if (!_views.empty()) {
if (_operation == StartTrim) {
_editor->maybe_locate_with_edit_preroll(
_views.begin()->view->region()->position());
}
if (_operation == EndTrim) {
_editor->maybe_locate_with_edit_preroll(
_views.begin()->view->region()->position() +
_views.begin()->view->region()->length());
}
}
if (!_editor->selection->selected (_primary)) {