diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index f96d465564..aabe07157b 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -209,7 +209,8 @@ PortGroup::io_from_bundle (boost::shared_ptr b) const return boost::shared_ptr (); } - return (*i)->io; + boost::shared_ptr io ((*i)->io.lock ()); + return io; } /** Remove bundles whose channels are already represented by other, larger bundles */ @@ -306,6 +307,7 @@ struct RouteIOs { } boost::shared_ptr route; + /* it's ok to use a shared_ptr here as RouteIOs structs are only used during ::gather () */ std::list > ios; }; diff --git a/gtk2_ardour/port_group.h b/gtk2_ardour/port_group.h index 3ae1df697d..f0bb1c4c58 100644 --- a/gtk2_ardour/port_group.h +++ b/gtk2_ardour/port_group.h @@ -75,7 +75,7 @@ public: boost::shared_ptr bundle; /** IO whose ports are in the bundle, or 0. This is so that we can do things like adding ports to the IO from matrix editor menus. */ - boost::shared_ptr io; + boost::weak_ptr io; Gdk::Color colour; bool has_colour; PBD::ScopedConnection changed_connection;