diff --git a/gtk2_ardour/io_button.cc b/gtk2_ardour/io_button.cc index 023c9258ac..3f153d1683 100644 --- a/gtk2_ardour/io_button.cc +++ b/gtk2_ardour/io_button.cc @@ -483,6 +483,9 @@ IOButton::port_pretty_name_changed (std::string pn) void IOButton::port_connected_or_disconnected (std::weak_ptr wa, std::weak_ptr wb) { + if (!_route) { + return; + } std::shared_ptr a = wa.lock (); std::shared_ptr b = wb.lock (); @@ -702,6 +705,14 @@ IOButton::update () std::shared_ptr bundle; _bundle_connections.drop_connections (); + if (!_route) { + /* There may still be a signal queued before `set_route (0)` unsets the route + * and unsubscribes. invalidation only happens when the button is destroyed. */ + set_text (_input ? _("Input") : _("Output")); + set_tooltip (this, ""); + return; + } + set_label (*this, _route->session (), bundle, _input ? _route->input () : _route->output ()); if (bundle) {