Make Session listen to DropReferences from Sources, and remove them. Call drop_references for a Source in one imnportant case which occurs during MIDI track creation.

git-svn-id: svn://localhost/ardour2/branches/3.0@6996 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-04-26 21:29:47 +00:00
parent e55f93ff61
commit e112ed3d6a
2 changed files with 2 additions and 0 deletions

View file

@ -1323,6 +1323,7 @@ MidiDiskstream::use_new_write_source (uint32_t n)
if (_write_source->is_empty ()) {
_write_source->mark_for_remove ();
_write_source->drop_references ();
_write_source.reset();
} else {
_write_source.reset();

View file

@ -2424,6 +2424,7 @@ Session::add_source (boost::shared_ptr<Source> source)
}
if (result.second) {
source->DropReferences.connect_same_thread (*this, boost::bind (&Session::remove_source, this, boost::weak_ptr<Source> (source)));
set_dirty();
}