fix VST plugin crash (from 35a9c63)
[ardour.git] / gtk2_ardour / midi_time_axis.cc
index be475216c17e0e9c57f94dd8f16257f690f28988..e412b82c32d10f5ef569b0d0c78b9e7ebba4eb32 100644 (file)
@@ -1509,8 +1509,9 @@ boost::shared_ptr<MidiRegion>
 MidiTimeAxisView::add_region (framepos_t pos, framecnt_t length, bool commit)
 {
        Editor* real_editor = dynamic_cast<Editor*> (&_editor);
-
-       real_editor->begin_reversible_command (Operations::create_region);
+       if (commit) {
+               real_editor->begin_reversible_command (Operations::create_region);
+       }
        playlist()->clear_changes ();
 
        real_editor->snap_to (pos, RoundNearest);