From 07a651d2ec0590ad8315de0fd43492b7238af908 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 3 Sep 2014 05:17:16 +0200 Subject: [PATCH] release shared route pointer kept by InternalSend when dropping refs. fixes "SessionHandleRef exists across session deletion" when using AuxSends --- libs/ardour/ardour/internal_send.h | 2 ++ libs/ardour/internal_send.cc | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 6feeb35c6d..71d8049cae 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -65,8 +65,10 @@ class LIBARDOUR_API InternalSend : public Send boost::shared_ptr _send_to; PBD::ID _send_to_id; PBD::ScopedConnection connect_c; + PBD::ScopedConnection source_connection; PBD::ScopedConnectionList target_connections; + void send_from_going_away (); void send_to_going_away (); void send_to_property_changed (const PBD::PropertyChange&); int connect_when_legal (); diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index e5c7232f48..33b299dfee 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -58,6 +58,7 @@ InternalSend::InternalSend (Session& s, init_gain (); + _send_from->DropReferences.connect_same_thread (source_connection, boost::bind (&InternalSend::send_from_going_away, this)); CycleStart.connect_same_thread (*this, boost::bind (&InternalSend::cycle_start, this, _1)); } @@ -117,6 +118,12 @@ InternalSend::target_io_changed () reset_panner(); } +void +InternalSend::send_from_going_away () +{ + _send_from.reset(); +} + void InternalSend::send_to_going_away () {