diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-22 20:21:43 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-22 20:21:43 +0000 |
commit | c83389b8ec5fef9553a401e6123b7e55702af9e2 (patch) | |
tree | 5580dd13b6275eefe67b9147ce96fa10db4d8674 /libs/ardour/region.cc | |
parent | 87fb46859c5950af7c00111afa81a00a1fad2196 (diff) |
cleanup up cleanup at session destruction; clarify the meaning of 3 signals (DropReferences & Destroyed in libardour ; CatchDeletion in the GTK UI); clarify ownership of objects (session no longer pays attention to DropReferences for objects that it is considered to own, such as routes, sources, etc); fix up MIDI parsing and a couple of other places by correcting syntax for return of values from a boost::signals2::signal (possible danger elsewhere to be checked)
git-svn-id: svn://localhost/ardour2/branches/3.0@6389 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r-- | libs/ardour/region.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index d706421c39..57d887f6a6 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -109,7 +109,7 @@ Region::Region (boost::shared_ptr<Source> src, nframes_t start, nframes_t length _sources.push_back (src); _master_sources.push_back (src); - src->GoingAway.connect_same_thread (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(src))); + src->DropReferences.connect_same_thread (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(src))); assert(_sources.size() > 0); _positional_lock_style = AudioTime; @@ -338,7 +338,6 @@ Region::Region (boost::shared_ptr<Source> src, const XMLNode& node) Region::~Region () { DEBUG_TRACE (DEBUG::Destruction, string_compose ("Region %1 destructor @ %2\n", _name, this)); - drop_references (); } void @@ -1416,7 +1415,12 @@ void Region::source_deleted (boost::weak_ptr<Source>) { _sources.clear (); - cerr << "Send drop ref signal from region " << ' ' << this << endl; + + /* this is a very special case: at least one of the region's + sources has bee deleted, so invalidate all references to + ourselves. + */ + drop_references (); } @@ -1586,14 +1590,14 @@ Region::use_sources (SourceList const & s) for (SourceList::const_iterator i = s.begin (); i != s.end(); ++i) { _sources.push_back (*i); - (*i)->GoingAway.connect_same_thread (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i))); + (*i)->DropReferences.connect_same_thread (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i))); unique_srcs.insert (*i); } for (SourceList::const_iterator i = s.begin (); i != s.end(); ++i) { _master_sources.push_back (*i); if (unique_srcs.find (*i) == unique_srcs.end()) { - (*i)->GoingAway.connect_same_thread (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i))); + (*i)->DropReferences.connect_same_thread (*this, boost::bind (&Region::source_deleted, this, boost::weak_ptr<Source>(*i))); } } } |