a variety of fixes aimed at preventing crashes caused by the (global) port matrix...
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 4 Nov 2012 23:41:52 +0000 (23:41 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 4 Nov 2012 23:41:52 +0000 (23:41 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13378 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/global_port_matrix.cc

index 0116f4e842d65cda93e01301892cc6c296db7604..02c72d723066f081fcdb8567ef0320176c2bc656 100644 (file)
@@ -62,6 +62,13 @@ ARDOUR_UI::set_session (Session *s)
 {
        SessionHandlePtr::set_session (s);
 
+       for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
+               GlobalPortMatrixWindow* w;
+               if ((w = _global_port_matrix[*i]->get()) != 0) {
+                       w->set_session (s);
+               }
+       }
+
        if (!_session) {
                return;
        }
index d7499904639e37d9091597dcbb765cb8e2fa5d8b..fcd9960e43fe75010db5a1d582c5d41653e52f12 100644 (file)
@@ -42,6 +42,10 @@ GlobalPortMatrix::GlobalPortMatrix (Gtk::Window* p, Session* s, DataType t)
 void
 GlobalPortMatrix::setup_ports (int dim)
 {
+       if (!_session) {
+               return;
+       }
+
        _ports[dim].suspend_signals ();
        _ports[dim].gather (_session, type(), dim == IN, false, show_only_bundles ());
        _ports[dim].resume_signals ();
@@ -50,6 +54,10 @@ GlobalPortMatrix::setup_ports (int dim)
 void
 GlobalPortMatrix::set_state (BundleChannel c[2], bool s)
 {
+       if (!_session) {
+               return;
+       }
+
        Bundle::PortList const & in_ports = c[IN].bundle->channel_ports (c[IN].channel);
        Bundle::PortList const & out_ports = c[OUT].bundle->channel_ports (c[OUT].channel);
 
@@ -178,6 +186,10 @@ void
 GlobalPortMatrixWindow::set_session (Session* s)
 {
        _port_matrix.set_session (s);
+
+       if (!s) {
+               hide ();
+       }
 }
 
 string