diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index 8d8cb447..4be10b24 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -533,6 +533,12 @@ void sfz::Synth::resetVoices(int numVoices) std::this_thread::sleep_for(1ms); } + // Empty the file pool loading queue and spinlock on it + filePool.emptyFileLoadingQueue(); + while (filePool.shouldEmptyQueue()) { + std::this_thread::sleep_for(1ms); + } + voices.clear(); for (int i = 0; i < numVoices; ++i) voices.push_back(std::make_unique(midiState));