13
0

drop route shared_ptr when Route::GoingAway is emitted

This commit is contained in:
Paul Davis 2017-06-21 12:54:39 -04:00
parent 6827dfe832
commit 302d15d2c0
2 changed files with 11 additions and 0 deletions

View File

@ -58,6 +58,7 @@ class LIBARDOUR_API DiskIOProcessor : public Processor
DiskIOProcessor (Session&, const std::string& name, Flag f);
void set_route (boost::shared_ptr<Route>);
void drop_route ();
static void set_buffering_parameters (BufferingPreset bp);

View File

@ -387,10 +387,20 @@ DiskIOProcessor::ChannelInfo::~ChannelInfo ()
capture_transition_buf = 0;
}
void
DiskIOProcessor::drop_route ()
{
_route.reset ();
}
void
DiskIOProcessor::set_route (boost::shared_ptr<Route> r)
{
_route = r;
if (_route) {
_route->DropReferences.connect_same_thread (*this, boost::bind (&DiskIOProcessor::drop_route, this));
}
}
/** Get the start, end, and length of a location "atomically".