1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed a potential deadlock in MPESynthesiser::turnOffAllVoices()

This commit is contained in:
ed 2019-06-04 17:09:41 +01:00
parent 16dd26649a
commit 919338130a

View file

@ -299,12 +299,14 @@ void MPESynthesiser::reduceNumVoices (const int newNumVoices)
void MPESynthesiser::turnOffAllVoices (bool allowTailOff)
{
const ScopedLock sl (voicesLock);
{
const ScopedLock sl (voicesLock);
// first turn off all voices (it's more efficient to do this immediately
// rather than to go through the MPEInstrument for this).
for (auto* voice : voices)
voice->noteStopped (allowTailOff);
// first turn off all voices (it's more efficient to do this immediately
// rather than to go through the MPEInstrument for this).
for (auto* voice : voices)
voice->noteStopped (allowTailOff);
}
// finally make sure the MPE Instrument also doesn't have any notes anymore.
instrument->releaseAllNotes();