Fix crash when closing session, recursive mon-section removal
authorRobin Gareus <robin@gareus.org>
Sat, 8 Dec 2018 19:15:53 +0000 (20:15 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 8 Dec 2018 19:15:53 +0000 (20:15 +0100)
gtk2_ardour/ardour_ui2.cc

index 97d639fc1bb5990d995811b6aa4b6b867d79a89f..53bccb64bcc54ba553096b70d0b309ef46575657 100644 (file)
@@ -821,6 +821,10 @@ ARDOUR_UI::update_title ()
 void
 ARDOUR_UI::toggle_use_monitor_section ()
 {
 void
 ARDOUR_UI::toggle_use_monitor_section ()
 {
+       if (!_session) {
+               return;
+       }
+
        RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), "UseMonitorSection");
        assert (act);  RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
        assert (tact);
        RefPtr<Action> act = ActionManager::get_action (X_("Monitor"), "UseMonitorSection");
        assert (act);  RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
        assert (tact);