Fixes a memory corruption upon closing the 2nd session
[ardour.git] / gtk2_ardour / monitor_section.cc
index 4bc5e5ab4700bfcf7acb2dbddc99a12cac286715..297aa04288225dd648ae3c5e1539457ce7a71c39 100644 (file)
@@ -185,8 +185,8 @@ MonitorSection::MonitorSection (Session* s)
        toggle_processorbox_button.set_name (X_("monitor section processors toggle"));
        set_tooltip (&toggle_processorbox_button, _("Allow one to add monitor effect processors"));
 
-       proctoggle = myactions.register_toggle_action (monitor_actions, "toggle-monitor-processor-box", _("Toggle Monitor Section Processor Box"),
-                                                      sigc::mem_fun(*this, &MonitorSection::update_processor_box));
+       proctoggle = ActionManager::get_action (X_("Monitor"), X_("toggle-monitor-processor-box"));
+       assert(proctoggle);
        toggle_processorbox_button.set_related_action (proctoggle);
 
        /* Knobs */
@@ -910,6 +910,9 @@ MonitorSection::register_actions ()
                        sigc::mem_fun (*this, &MonitorSection::solo_use_afl));
        myactions.register_radio_action (solo_actions, solo_group, "solo-use-pfl", _("Pre Fade Listen (PFL) solo"),
                        sigc::mem_fun (*this, &MonitorSection::solo_use_pfl));
+
+       proctoggle = myactions.register_toggle_action (monitor_actions, "toggle-monitor-processor-box", _("Toggle Monitor Section Processor Box"),
+                       sigc::mem_fun(*this, &MonitorSection::update_processor_box));
 }
 
 void