Signal the filepool to empty the queue and wait for completion

This commit is contained in:
Paul Ferrand 2019-11-30 16:17:27 +01:00
parent 17236412e3
commit 8b426fa6e2

View file

@ -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<Voice>(midiState));