Fix disappearing plugin menu (#3182)
authorCarl Hetherington <carl@carlh.net>
Tue, 25 May 2010 23:39:44 +0000 (23:39 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 25 May 2010 23:39:44 +0000 (23:39 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7163 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/midi_time_axis.h
gtk2_ardour/route_time_axis.cc

index 4e6b868a9083819d21ed1b0499eb24c111352e1a..e965e0940364455cfe1c74ffcd9b330d817456c3 100644 (file)
@@ -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;
index 9093abca1b12e57200b05a6ad73bc88288363ea7..c0f1a13613acd3992d49e202a78f67f6d780562a 100644 (file)
@@ -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());
 }