From c15def27cff7f32963d6acb15fc14dfdd00c1e4a Mon Sep 17 00:00:00 2001 From: paulfd Date: Sat, 28 Sep 2019 15:57:03 +0200 Subject: [PATCH] Clean up the activation lists on clearing the synth --- sfizz/Synth.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sfizz/Synth.cpp b/sfizz/Synth.cpp index a2e61aba..cc3c2b04 100644 --- a/sfizz/Synth.cpp +++ b/sfizz/Synth.cpp @@ -108,6 +108,14 @@ void sfz::Synth::buildRegion(const std::vector& regionOpcodes) void sfz::Synth::clear() { + for (auto &voice: voices) + voice->reset(); + for (auto& list: noteActivationLists) + list.clear(); + for (auto& list: ccActivationLists) + list.clear(); + regions.clear(); + filePool.clear(); hasGlobal = false; hasControl = false; numGroups = 0; @@ -121,8 +129,6 @@ void sfz::Synth::clear() globalOpcodes.clear(); masterOpcodes.clear(); groupOpcodes.clear(); - regions.clear(); - filePool.clear(); } void sfz::Synth::handleGlobalOpcodes(const std::vector& members)