Fix a potential memory-corruption
Disk-writer run() can concurrently use the ringbuffer after it was free()ed by the butler thread.
This commit is contained in:
parent
076e9fddd4
commit
dfbda9e0f6
@ -492,6 +492,9 @@ Session::butler_transport_work ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ptw & PostTransportAdjustCaptureBuffering) {
|
if (ptw & PostTransportAdjustCaptureBuffering) {
|
||||||
|
/* need to prevent concurrency with ARDOUR::DiskWriter::run(),
|
||||||
|
* DiskWriter::adjust_buffering() re-allocates the ringbuffer */
|
||||||
|
Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());
|
||||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||||
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user