diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h index 4e6b868a90..e965e09403 100644 --- a/gtk2_ardour/midi_time_axis.h +++ b/gtk2_ardour/midi_time_axis.h @@ -108,10 +108,7 @@ class MidiTimeAxisView : public RouteTimeAxisView void route_active_changed (); - void add_insert_to_subplugin_menu (ARDOUR::Processor *); - bool _ignore_signals; - Gtk::Menu _subplugin_menu; MidiScroomer* _range_scroomer; PianoRollHeader* _piano_roll_header; ARDOUR::NoteMode _note_mode; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 9093abca1b..c0f1a13613 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -392,6 +392,12 @@ RouteTimeAxisView::build_automation_action_menu () { using namespace Menu_Helpers; + /* detach subplugin_menu from automation_action_menu before we delete automation_action_menu, + otherwise bad things happen (see comment for similar case in MidiTimeAxisView::build_automation_action_menu) + */ + + detach_menu (subplugin_menu); + delete automation_action_menu; automation_action_menu = new Menu; @@ -408,9 +414,9 @@ RouteTimeAxisView::build_automation_action_menu () items.push_back (MenuElem (_("Hide All Automation"), sigc::mem_fun(*this, &RouteTimeAxisView::hide_all_automation))); - /* attach the plugin submenu. It may have previously been used elsewhere, so we detach it first. */ + /* Attach the plugin submenu. It may have previously been used elsewhere, + so it was detached above */ - detach_menu (subplugin_menu); items.push_back (MenuElem (_("Plugins"), subplugin_menu)); items.back().set_sensitive (!subplugin_menu.items().empty()); }