aboutsummaryrefslogtreecommitdiff
path: root/src/audio_core/renderer/system.cpp
diff options
context:
space:
mode:
authorkraibse <33869366+kraibse@users.noreply.github.com>2026-10-30 01:15:40 +0100
committerkraibse <33869366+kraibse@users.noreply.github.com>2026-10-30 01:16:24 +0100
commitd56039ace99338293658f931a871e4dba203e3ab (patch)
tree80cfe34a4bb3732f38d10cf3632148c211607241 /src/audio_core/renderer/system.cpp
parentdfa55d1679758dc8e5b80374c230bae5a733c6c8 (diff)
Fix hang on emulation stop when audio renderer outlives its manager
The Switch 2 aud:u client hands out an IAudioRendererManager the guest may close right after opening a renderer. The Manager was owned by value and renderers held a plain reference, so it was destroyed (stopping the system manager thread) while the renderer lived on. System::Stop() then waited forever on terminate_event, hanging shutdown. - Share ownership of the audio Manager with each IAudioRenderer - Bound the terminate_event wait in System::Stop() - Bound the emu thread wait in MainWindow::OnEmulationStopped() Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/audio_core/renderer/system.cpp')
-rw-r--r--src/audio_core/renderer/system.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp
index b7675ff5de..2e3e741d3e 100644
--- a/src/audio_core/renderer/system.cpp
+++ b/src/audio_core/renderer/system.cpp
@@ -444,7 +444,10 @@ void System::Stop() {
}
if (execution_mode == ExecutionMode::Auto) {
- terminate_event.Wait();
+ // The system manager thread signals this; it may already be gone during shutdown.
+ if (!terminate_event.WaitFor(std::chrono::seconds(1))) {
+ LOG_WARNING(Service_Audio, "Timed out waiting for the renderer to terminate");
+ }
}
}