Fix crash when hiding multiple tracks
authorRobin Gareus <robin@gareus.org>
Mon, 11 Sep 2017 16:30:32 +0000 (18:30 +0200)
committerRobin Gareus <robin@gareus.org>
Mon, 11 Sep 2017 16:30:32 +0000 (18:30 +0200)
Editor::hide_track_in_display() -> EditorRoutes::hide_track_in_display()
and ensuing calls to sync the treeview may modify the selection
(de-select hidden tracks) and invalidate selection->tracks

gtk2_ardour/editor.cc

index 210f6350befe8e38c7ab4f938a0f15c9987b69e8..4f4bee48393bfc2a621b1d293ddc807bc4715451 100644 (file)
@@ -5510,6 +5510,10 @@ Editor::hide_track_in_display (TimeAxisView* tv, bool apply_to_selection)
        if (!tv) {
                return;
        }
+
+       DisplaySuspender ds;
+       PresentationInfo::ChangeSuspender cs;
+
        if (apply_to_selection) {
                for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ) {