SoundControl crash fix

This commit is contained in:
Anuken
2026-09-11 00:56:38 -04:00
parent 43aa0d95f5
commit cc5a63109a
+6 -4
View File
@@ -392,13 +392,15 @@ public class SoundControl{
ambientThread.inputSources.add(source);
}else{
launchingAmbientThread = true;
ambientThread = new AudioThread();
ambientThread.setDaemon(true);
AudioThread thread = new AudioThread();
thread.setDaemon(true);
ambientThread = thread;
//start thread with all the sources that were added during launch
Core.app.post(() -> {
if(ambientThread != null){
if(!ambientThread.isAlive()) ambientThread.start();
//only start if this is still the active thread, and only ever once
if(ambientThread == thread){
thread.start();
launchingAmbientThread = false;
}
});