diff options
author | Mary <me@thog.eu> | 2021-06-29 19:37:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 19:37:13 +0200 |
commit | 00ce9eea620652b97b4d3e8cd9218c6fccff8b1c (patch) | |
tree | f488b1b378a8ecbeaf54d5a7916062784a5588dc /Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs | |
parent | fbb4019ed5c12c4a888c7b09db648ac595366896 (diff) |
Fix disposing of IPC sessions server at emulation stop (#2334)
Diffstat (limited to 'Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs')
-rw-r--r-- | Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs b/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs index 925a1cb4..884e75ed 100644 --- a/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs +++ b/Ryujinx.Audio.Backends.SoundIo/SoundIoHardwareDeviceSession.cs @@ -17,6 +17,7 @@ namespace Ryujinx.Audio.Backends.SoundIo private DynamicRingBuffer _ringBuffer; private ulong _playedSampleCount; private ManualResetEvent _updateRequiredEvent; + private int _disposeState; public SoundIoHardwareDeviceSession(SoundIoHardwareDeviceDriver driver, IVirtualMemoryManager memoryManager, SampleFormat requestedSampleFormat, uint requestedSampleRate, uint requestedChannelCount) : base(memoryManager, requestedSampleFormat, requestedSampleRate, requestedChannelCount) { @@ -435,7 +436,10 @@ namespace Ryujinx.Audio.Backends.SoundIo public override void Dispose() { - Dispose(true); + if (Interlocked.CompareExchange(ref _disposeState, 1, 0) == 0) + { + Dispose(true); + } } } } |