From 15f98d6b311cb7493808898aab3b588c8bdd8dbb Mon Sep 17 00:00:00 2001 From: Brendan Robert Date: Tue, 23 Jan 2024 21:50:51 -0600 Subject: [PATCH] Fix concurrent modification error in detach method --- .../Apple/tools/jace/src/main/java/jace/core/SoundMixer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Platform/Apple/tools/jace/src/main/java/jace/core/SoundMixer.java b/Platform/Apple/tools/jace/src/main/java/jace/core/SoundMixer.java index a275514d..de6c7d89 100644 --- a/Platform/Apple/tools/jace/src/main/java/jace/core/SoundMixer.java +++ b/Platform/Apple/tools/jace/src/main/java/jace/core/SoundMixer.java @@ -283,7 +283,8 @@ public class SoundMixer extends Device { MUTE = true; PLAYBACK_ENABLED = false; - for (SoundBuffer buffer : buffers) { + while (!buffers.isEmpty()) { + SoundBuffer buffer = buffers.get(0); try { buffer.shutdown(); } catch (InterruptedException | ExecutionException e) {