Browse Source

Fixed a potential deadlock in MPESynthesiser::turnOffAllVoices()

tags/2021-05-28
ed 6 years ago
parent
commit
919338130a
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      modules/juce_audio_basics/mpe/juce_MPESynthesiser.cpp

+ 7
- 5
modules/juce_audio_basics/mpe/juce_MPESynthesiser.cpp View File

@@ -299,12 +299,14 @@ void MPESynthesiser::reduceNumVoices (const int newNumVoices)
void MPESynthesiser::turnOffAllVoices (bool allowTailOff) 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. // finally make sure the MPE Instrument also doesn't have any notes anymore.
instrument->releaseAllNotes(); instrument->releaseAllNotes();


Loading…
Cancel
Save