Protect the clear() function of the synth
This commit is contained in:
parent
3a26ddb206
commit
d8e75c662b
1 changed files with 5 additions and 0 deletions
|
|
@ -108,6 +108,11 @@ void sfz::Synth::buildRegion(const std::vector<Opcode>& regionOpcodes)
|
||||||
|
|
||||||
void sfz::Synth::clear()
|
void sfz::Synth::clear()
|
||||||
{
|
{
|
||||||
|
AtomicDisabler callbackDisabler { canEnterCallback };
|
||||||
|
while (inCallback) {
|
||||||
|
std::this_thread::sleep_for(1ms);
|
||||||
|
}
|
||||||
|
|
||||||
for (auto &voice: voices)
|
for (auto &voice: voices)
|
||||||
voice->reset();
|
voice->reset();
|
||||||
for (auto& list: noteActivationLists)
|
for (auto& list: noteActivationLists)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue