Protect the clear() function of the synth

This commit is contained in:
paulfd 2019-09-28 18:52:22 +02:00
parent 3a26ddb206
commit d8e75c662b

View file

@ -108,6 +108,11 @@ void sfz::Synth::buildRegion(const std::vector<Opcode>& regionOpcodes)
void sfz::Synth::clear()
{
AtomicDisabler callbackDisabler { canEnterCallback };
while (inCallback) {
std::this_thread::sleep_for(1ms);
}
for (auto &voice: voices)
voice->reset();
for (auto& list: noteActivationLists)