mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 23:41:19 +01:00
7c46497f04
The main EmuThread (in Core) is responsible for both initialising the audio stream and shutting it down properly. When the core is shutting down (when state is State::PowerDown), it is possible that the CPU or CPU-GPU thread and the UI thread will both try to stop the audio stream at the same time, which is an issue because some audio backends such as cubeb are not thread-safe. This commit prevents the race from ever happening in the first place by removing the call to AudioCommon::SetSoundStreamRunning from CPU::RunAdjacentSystems, which is actually completely unnecessary when shutting down because Core::EmuThread is going to stop the stream and perform more cleanup anyway. Should fix https://bugs.dolphin-emu.org/issues/11722