diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-09-11 22:40:23 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2016-09-11 22:53:00 +1000 |
commit | fc0114a7e28f5b28d6448ec900852dc485b1640d (patch) | |
tree | e73e2eec661a49f35902734e7caa8129c062c77e /gtk2_ardour/editor_drag.cc | |
parent | f91e591f40cfe1a2634aff48045c32fbbf24c43a (diff) |
Fix #7015, Crash while aborting Region trim using Esc key
There were two issues:
The first is that TrimDrag::aborted was calling TrimDrag::finished with a null
GdkEvent which caused a segfault when dereferencing. So avoid that by passing
in a dummy event as we are just going to undo the operation in the next step
anyway so it shouldn't matter if it is valid(AFAICT).
The other is that TrimDrag:aborted was calling Editor::undo() which was in turn
calling TrimDrag::aborted leading to infinite recursion and stack overflow.
Calling Session::undo() directly seems to avoid that issue.
This fix feels like a bit of a hack...but it seems to work and is better than a
crash.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 8e614a8471..c35d1fedef 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3087,10 +3087,11 @@ TrimDrag::aborted (bool movement_occurred) behind which may be slightly odd from the user's point of view. */ - finished (0, true); + GdkEvent ev; + finished (&ev, true); if (movement_occurred) { - _editor->undo (); + _editor->session()->undo (1); } for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) { |