aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs
diff options
context:
space:
mode:
authorMary <me@thog.eu>2021-06-29 19:37:13 +0200
committerGitHub <noreply@github.com>2021-06-29 19:37:13 +0200
commit00ce9eea620652b97b4d3e8cd9218c6fccff8b1c (patch)
treef488b1b378a8ecbeaf54d5a7916062784a5588dc /Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs
parentfbb4019ed5c12c4a888c7b09db648ac595366896 (diff)
Fix disposing of IPC sessions server at emulation stop (#2334)
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs13
1 files changed, 5 insertions, 8 deletions
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();
}