X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fport_matrix.cc;h=b3b5a91ed34a9b404a6adeffc3cf7f86f7230f6a;hb=5fef65538040fbac1b9edd1847a269aa925a49c9;hp=e8108555e6f552d71e9aab673824aae42236291b;hpb=4861eca97483128e5febb575b94688581abb0154;p=ardour.git diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index e8108555e6..b3b5a91ed3 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -43,6 +43,7 @@ using namespace std; using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; /** PortMatrix constructor. * @param session Our session. @@ -158,7 +159,7 @@ PortMatrix::init () _session->engine().PortRegisteredOrUnregistered.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context()); /* watch for route order keys changing, which changes the order of things in our global ports list(s) */ - Route::SyncOrderKeys.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports_proxy, this, _1), gui_context()); + Route::SyncOrderKeys.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports_proxy, this), gui_context()); /* Part 3: other stuff */ @@ -609,6 +610,7 @@ PortMatrix::disassociate_all_on_channel (boost::weak_ptr bundle, uint32_ void PortMatrix::setup_global_ports () { + if (!_session || _session->deletion_in_progress()) return; ENSURE_GUI_THREAD (*this, &PortMatrix::setup_global_ports) for (int i = 0; i < 2; ++i) { @@ -619,15 +621,13 @@ PortMatrix::setup_global_ports () } void -PortMatrix::setup_global_ports_proxy (RouteSortOrderKey sk) +PortMatrix::setup_global_ports_proxy () { - if (sk == EditorSort) { - /* Avoid a deadlock by calling this in an idle handler: see IOSelector::io_changed_proxy - for a discussion. - */ + /* Avoid a deadlock by calling this in an idle handler: see IOSelector::io_changed_proxy + for a discussion. + */ - Glib::signal_idle().connect_once (sigc::mem_fun (*this, &PortMatrix::setup_global_ports)); - } + Glib::signal_idle().connect_once (sigc::mem_fun (*this, &PortMatrix::setup_global_ports)); } void @@ -709,7 +709,7 @@ PortMatrix::io_from_bundle (boost::shared_ptr b) const bool PortMatrix::can_add_channels (boost::shared_ptr b) const { - return io_from_bundle (b); + return io_from_bundle (b) != 0; } void @@ -732,7 +732,7 @@ PortMatrix::add_channel (boost::shared_ptr b, DataType t) bool PortMatrix::can_remove_channels (boost::shared_ptr b) const { - return io_from_bundle (b); + return io_from_bundle (b) != 0; } void @@ -1139,7 +1139,7 @@ PortMatrix::get_association (PortMatrixNode node) const } - /* NOTREACHED */ + abort(); /* NOTREACHED */ return PortMatrixNode::NOT_ASSOCIATED; }