summaryrefslogtreecommitdiff
path: root/libs/ardour/region_factory.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-11-28 00:49:04 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-11-28 00:49:04 +0000
commit51693a3a5835a7c2deb16242d14d73fbb7881382 (patch)
tree2c576e25b2f1b945be6bdcf30cd9245b27d93d90 /libs/ardour/region_factory.cc
parentc5db9a21b990b55e1b515a65a99bdc504d0af89c (diff)
tracing and small fixes to improve object destruction pathways
git-svn-id: svn://localhost/ardour2/branches/3.0@6195 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/region_factory.cc')
-rw-r--r--libs/ardour/region_factory.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/ardour/region_factory.cc b/libs/ardour/region_factory.cc
index 8b2d30d511..91cc2dbe2a 100644
--- a/libs/ardour/region_factory.cc
+++ b/libs/ardour/region_factory.cc
@@ -18,6 +18,7 @@
*/
#include "pbd/error.h"
+#include "pbd/boost_debug.h"
#include "ardour/session.h"
@@ -45,6 +46,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, nframes_t start,
if ((other_a = boost::dynamic_pointer_cast<AudioRegion>(region)) != 0) {
AudioRegion* ar = new AudioRegion (other_a, start, length, name, layer, flags);
+ boost_debug_shared_ptr_mark_interesting (ar, typeid (ar).name());
boost::shared_ptr<AudioRegion> arp (ar);
boost::shared_ptr<Region> ret (boost::static_pointer_cast<Region> (arp));
ret->unlock_property_changes ();
@@ -76,7 +78,9 @@ RegionFactory::create (boost::shared_ptr<const Region> region)
boost::shared_ptr<const MidiRegion> mr;
if ((ar = boost::dynamic_pointer_cast<const AudioRegion>(region)) != 0) {
- boost::shared_ptr<Region> ret (new AudioRegion (ar));
+ AudioRegion* arn = new AudioRegion (ar);
+ boost_debug_shared_ptr_mark_interesting (arn, typeid (arn).name());
+ boost::shared_ptr<Region> ret (arn);
ret->unlock_property_changes ();
/* pure copy constructor - no CheckNewRegion emitted */
return ret;
@@ -114,6 +118,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, const SourceList& srcs,
if ((other = boost::dynamic_pointer_cast<AudioRegion>(region)) != 0) {
AudioRegion* ar = new AudioRegion (other, srcs, srcs.front()->length(srcs.front()->timeline_position()), name, layer, flags);
+ boost_debug_shared_ptr_mark_interesting (ar, typeid (ar).name());
boost::shared_ptr<AudioRegion> arp (ar);
boost::shared_ptr<Region> ret (boost::static_pointer_cast<Region> (arp));
ret->unlock_property_changes ();
@@ -152,6 +157,7 @@ RegionFactory::create (const SourceList& srcs, nframes_t start, nframes_t length
if (srcs[0]->type() == DataType::AUDIO) {
AudioRegion* ar = new AudioRegion (srcs, start, length, name, layer, flags);
+ boost_debug_shared_ptr_mark_interesting (ar, typeid (ar).name());
boost::shared_ptr<AudioRegion> arp (ar);
boost::shared_ptr<Region> ret (boost::static_pointer_cast<Region> (arp));
ret->unlock_property_changes ();
@@ -184,7 +190,9 @@ RegionFactory::create (SourceList& srcs, const XMLNode& node)
}
if (srcs[0]->type() == DataType::AUDIO) {
- boost::shared_ptr<Region> ret (new AudioRegion (srcs, node));
+ AudioRegion* ar = new AudioRegion (srcs, node);
+ boost_debug_shared_ptr_mark_interesting (ar, typeid (ar).name());
+ boost::shared_ptr<Region> ret (ar);
ret->unlock_property_changes ();
CheckNewRegion (ret);
return ret;
@@ -205,7 +213,9 @@ RegionFactory::create (boost::shared_ptr<Source> src, nframes_t start, nframes_t
boost::shared_ptr<MidiSource> ms;
if ((as = boost::dynamic_pointer_cast<AudioSource>(src)) != 0) {
- boost::shared_ptr<Region> ret (new AudioRegion (as, start, length, name, layer, flags));
+ AudioRegion* ar = new AudioRegion (as, start, length, name, layer, flags);
+ boost_debug_shared_ptr_mark_interesting (ar, typeid (ar).name());
+ boost::shared_ptr<Region> ret (ar);
ret->unlock_property_changes ();
if (announce) {
CheckNewRegion (ret);