aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
index 713ef6cc..0ce65e3a 100644
--- a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
+++ b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
@@ -5,6 +5,7 @@ using Ryujinx.HLE.HOS.Kernel.Common;
using Ryujinx.HLE.HOS.Kernel.Memory;
using Ryujinx.HLE.HOS.Kernel.Process;
using Ryujinx.HLE.Loaders.Executables;
+using Ryujinx.Memory;
using System;
using System.Collections.Generic;
using System.IO;
@@ -566,6 +567,11 @@ namespace Ryujinx.HLE.HOS.Services.Ro
_owner = context.Process.HandleTable.GetKProcess(context.Request.HandleDesc.ToCopy[0]);
context.Device.System.KernelContext.Syscall.CloseHandle(context.Request.HandleDesc.ToCopy[0]);
+ if (_owner?.CpuMemory is IRefCounted rc)
+ {
+ rc.IncrementReferenceCount();
+ }
+
return ResultCode.Success;
}
@@ -579,6 +585,11 @@ namespace Ryujinx.HLE.HOS.Services.Ro
}
_nroInfos.Clear();
+
+ if (_owner?.CpuMemory is IRefCounted rc)
+ {
+ rc.DecrementReferenceCount();
+ }
}
}
}