diff options
author | Carl Hetherington <carl@carlh.net> | 2011-03-01 02:04:50 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-03-01 02:04:50 +0000 |
commit | 4b5a59142b37fd5dedc6dbaee19c89404b01de2c (patch) | |
tree | 8973894c80b1b553fb4ff19e201f88d83fa9ad01 | |
parent | b741c14f3e12562df03813a192c11045d46d236c (diff) |
Make the session watch sources' DropReferences and drop accordingly. Remove a now-redundant call to remove_source in AudioDiskstream. Make the MidiDiskstream drop references on write sources that it wants rid of, so that the sources are actually destroyed.
git-svn-id: svn://localhost/ardour2/branches/3.0@8998 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 2 | ||||
-rw-r--r-- | libs/ardour/midi_diskstream.cc | 1 | ||||
-rw-r--r-- | libs/ardour/session.cc | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 8a161c3977..2c0dcb3e97 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -1404,7 +1404,6 @@ AudioDiskstream::transport_stopped_wallclock (struct tm& when, time_t twhen, boo (*chan)->write_source->mark_for_remove (); (*chan)->write_source->drop_references (); - _session.remove_source ((*chan)->write_source); (*chan)->write_source.reset (); } @@ -1963,7 +1962,6 @@ AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/) if ((*chan)->write_source->removable()) { (*chan)->write_source->mark_for_remove (); (*chan)->write_source->drop_references (); - _session.remove_source ((*chan)->write_source); } (*chan)->write_source.reset (); diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index 89a497cf01..abde495288 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -943,6 +943,7 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen if (_write_source) { _write_source->mark_for_remove (); + _write_source->drop_references (); _write_source.reset(); } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index b6b238a398..cc791af862 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2676,6 +2676,8 @@ Session::add_source (boost::shared_ptr<Source> source) Analyser::queue_source_for_analysis (source, false); } } + + source->DropReferences.connect_same_thread (*this, boost::bind (&Session::remove_source, this, boost::weak_ptr<Source> (source))); } } |