mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 14:15:46 +01:00
Ignore cycle-start/end for unregistered ports
Should fix a race during Session::destroy(), Port::PortDrop which unregisters ports with the backend, but the actual port instance will still exist. The engine does no longer have a session-pointer and only calls CycleStart(); CycleEnd() to clear port-buffers. Trying to clear and already unregistered Port will crash.
This commit is contained in:
parent
8b380a423a
commit
1937c74191
2 changed files with 7 additions and 7 deletions
|
|
@ -58,12 +58,12 @@ AudioPort::cycle_start (pframes_t nframes)
|
|||
void
|
||||
AudioPort::cycle_end (pframes_t nframes)
|
||||
{
|
||||
if (sends_output() && !_buffer->written()) {
|
||||
if (!_buffer->data (0)) {
|
||||
get_audio_buffer (nframes);
|
||||
}
|
||||
if (_buffer->capacity() >= nframes) {
|
||||
_buffer->silence (nframes);
|
||||
if (sends_output() && !_buffer->written() && _port_handle) {
|
||||
if (!_buffer->data (0)) {
|
||||
get_audio_buffer (nframes);
|
||||
}
|
||||
if (_buffer->capacity() >= nframes) {
|
||||
_buffer->silence (nframes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ MidiPort::cycle_start (pframes_t nframes)
|
|||
|
||||
_buffer->clear ();
|
||||
|
||||
if (sends_output ()) {
|
||||
if (sends_output () && _port_handle) {
|
||||
port_engine.midi_clear (port_engine.get_buffer (_port_handle, nframes));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue