Fix MIDI note cut
1. Editor::cut_copy() calls begin_reversible_command ("cut MIDI") 2. Editor::cut_copy_midi calls mrv->cut_copy_clear() 3. MidiRegionView::cut_copy_clear calls start_note_diff_command() 4. second call to begin_reversible_command() - debug builds assert() here, optimized builds continue 5. abort_reversible_command() is called, _current_trans = NULL; 6. MidiModel::apply_diff_command_as_subcommand() 7. Session::add_command, segfault because _current_trans == NULL ``` An UNDO transaction was started while a prior command was underway. Aborting command (midi edit) and prior (cut MIDI) ```
This commit is contained in:
parent
e6570b2247
commit
6a57baf193
@ -3764,21 +3764,28 @@ MidiRegionView::cut_copy_clear (Editing::CutCopyOp op)
|
|||||||
|
|
||||||
if (op != Copy) {
|
if (op != Copy) {
|
||||||
|
|
||||||
start_note_diff_command();
|
|
||||||
|
|
||||||
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
|
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case Copy:
|
case Copy:
|
||||||
break;
|
break;
|
||||||
case Delete:
|
case Delete:
|
||||||
case Cut:
|
|
||||||
case Clear:
|
case Clear:
|
||||||
|
start_note_diff_command();
|
||||||
|
/* fallthrough */
|
||||||
|
case Cut:
|
||||||
|
/* for Cut, Editor::cut_copy already started an undo operation,
|
||||||
|
* so we cannot call start_note_diff_command ()
|
||||||
|
*/
|
||||||
|
if (!_note_diff_command) {
|
||||||
|
_note_diff_command = _model->new_note_diff_command ("Cut");
|
||||||
|
}
|
||||||
note_diff_remove_note (*i);
|
note_diff_remove_note (*i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_note_diff();
|
apply_note_diff (op == Cut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user