From 00ce9eea620652b97b4d3e8cd9218c6fccff8b1c Mon Sep 17 00:00:00 2001 From: Mary <me@thog.eu> Date: Tue, 29 Jun 2021 19:37:13 +0200 Subject: Fix disposing of IPC sessions server at emulation stop (#2334) --- Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs') diff --git a/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs b/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs index 62e118d9..0f38e685 100644 --- a/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs @@ -4,10 +4,12 @@ using System.Security.Cryptography; namespace Ryujinx.HLE.HOS.Services.Spl { [Service("csrng")] - class IRandomInterface : IpcService, IDisposable + class IRandomInterface : DisposableIpcService { private RNGCryptoServiceProvider _rng; + private object _lock = new object(); + public IRandomInterface(ServiceCtx context) { _rng = new RNGCryptoServiceProvider(); @@ -26,14 +28,9 @@ namespace Ryujinx.HLE.HOS.Services.Spl return ResultCode.Success; } - public void Dispose() - { - Dispose(true); - } - - protected virtual void Dispose(bool disposing) + protected override void Dispose(bool isDisposing) { - if (disposing) + if (isDisposing) { _rng.Dispose(); } -- cgit v1.2.3-70-g09d2