From 49b66c2ba953134e01cf589e991ed9b564aaf8d3 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Fri, 23 Oct 2020 14:44:20 +0200 Subject: [PATCH] Clear the loading queues before changing the file --- src/sfizz/Synth.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index 3365f791..4103f388 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -194,6 +194,9 @@ void sfz::Synth::clear() { const std::lock_guard disableCallback { callbackGuard }; + // Clear the background queues before removing everyone + resources.filePool.waitForBackgroundLoading(); + for (auto& voice : voices) voice->reset(); for (auto& list : noteActivationLists)