diff options
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/pannable.h | 4 | ||||
-rw-r--r-- | libs/ardour/pannable.cc | 6 | ||||
-rw-r--r-- | libs/ardour/panner.cc | 2 | ||||
-rw-r--r-- | libs/ardour/panner_shell.cc | 7 | ||||
-rw-r--r-- | libs/ardour/route.cc | 5 | ||||
-rw-r--r-- | libs/ardour/session.cc | 4 |
6 files changed, 20 insertions, 8 deletions
diff --git a/libs/ardour/ardour/pannable.h b/libs/ardour/ardour/pannable.h index f7934e974d..c30bd0a068 100644 --- a/libs/ardour/ardour/pannable.h +++ b/libs/ardour/ardour/pannable.h @@ -48,7 +48,7 @@ class Pannable : public PBD::Stateful, public Automatable, public SessionHandleR boost::shared_ptr<AutomationControl> pan_frontback_control; boost::shared_ptr<AutomationControl> pan_lfe_control; - boost::shared_ptr<Panner> panner() const { return _panner; } + boost::shared_ptr<Panner> panner() const { return _panner.lock(); } void set_panner(boost::shared_ptr<Panner>); Session& session() { return _session; } @@ -83,7 +83,7 @@ class Pannable : public PBD::Stateful, public Automatable, public SessionHandleR bool has_state() const { return _has_state; } protected: - boost::shared_ptr<Panner> _panner; + boost::weak_ptr<Panner> _panner; AutoState _auto_state; AutoStyle _auto_style; gint _touching; diff --git a/libs/ardour/pannable.cc b/libs/ardour/pannable.cc index 1a56fe87cb..b4744d5658 100644 --- a/libs/ardour/pannable.cc +++ b/libs/ardour/pannable.cc @@ -256,8 +256,10 @@ Pannable::set_state (const XMLNode& root, int /*version - not used*/) string Pannable::value_as_string (boost::shared_ptr<AutomationControl> ac) const { - if (_panner) { - return _panner->value_as_string (ac); + boost::shared_ptr<Panner> p = panner (); + + if (p) { + return p->value_as_string (ac); } return Automatable::value_as_string (ac); diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index 9ad49c12c5..6498c2777a 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -19,6 +19,7 @@ #include "ardour/audio_buffer.h" #include "ardour/buffer_set.h" +#include "ardour/debug.h" #include "ardour/panner.h" #include "ardour/pannable.h" #include "ardour/session.h" @@ -35,6 +36,7 @@ Panner::Panner (boost::shared_ptr<Pannable> p) Panner::~Panner () { + DEBUG_TRACE(PBD::DEBUG::Destruction, string_compose ("panner @ %1 destructor, pannable is %2\n", this, _pannable)); } void diff --git a/libs/ardour/panner_shell.cc b/libs/ardour/panner_shell.cc index ffe8e66ceb..ecf7adf990 100644 --- a/libs/ardour/panner_shell.cc +++ b/libs/ardour/panner_shell.cc @@ -33,6 +33,7 @@ #include <glibmm.h> #include "pbd/cartesian.h" +#include "pbd/boost_debug.h" #include "pbd/convert.h" #include "pbd/error.h" #include "pbd/failed_constructor.h" @@ -45,6 +46,7 @@ #include "ardour/audio_buffer.h" #include "ardour/automatable.h" #include "ardour/buffer_set.h" +#include "ardour/debug.h" #include "ardour/pannable.h" #include "ardour/panner.h" #include "ardour/panner_manager.h" @@ -70,6 +72,7 @@ PannerShell::PannerShell (string name, Session& s, boost::shared_ptr<Pannable> p PannerShell::~PannerShell () { + DEBUG_TRACE(DEBUG::Destruction, string_compose ("panner shell for %1 destructor, pannable is %2\n", _name, _pannable)); } void @@ -101,7 +104,9 @@ PannerShell::configure_io (ChanCount in, ChanCount out) abort (); } - _panner.reset (pi->descriptor.factory (_pannable, _session.get_speakers())); + Panner* p = pi->descriptor.factory (_pannable, _session.get_speakers()); + boost_debug_shared_ptr_mark_interesting (p, "Panner"); + _panner.reset (p); _panner->configure_io (in, out); Changed (); /* EMIT SIGNAL */ diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 15907444f0..2e60f0fb76 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -27,6 +27,7 @@ #include "pbd/memento_command.h" #include "pbd/stacktrace.h" #include "pbd/convert.h" +#include "pbd/boost_debug.h" #include "evoral/Curve.hpp" @@ -118,7 +119,9 @@ Route::init () /* panning */ - _pannable.reset (new Pannable (_session)); + Pannable* p = new Pannable (_session); + boost_debug_shared_ptr_mark_interesting (p, "Pannable"); + _pannable.reset (p); /* input and output objects */ diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index e569188a38..aa0b29ed1e 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -323,12 +323,12 @@ Session::destroy () /* not strictly necessary, but doing it here allows the shared_ptr debugging to work */ playlists.reset (); - boost_debug_list_ptrs (); - delete _locations; delete _speakers; DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n"); + + boost_debug_list_ptrs (); } void |