diff --git a/Ryujinx/OsHle/Handles/HDomain.cs b/Ryujinx/OsHle/Handles/HDomain.cs index fd252f5d7a..e781602a11 100644 --- a/Ryujinx/OsHle/Handles/HDomain.cs +++ b/Ryujinx/OsHle/Handles/HDomain.cs @@ -17,7 +17,7 @@ namespace Ryujinx.OsHle.Handles ObjIds = new IdPool(); } - public int GenertateObjectId(object Obj) + public int GenerateObjectId(object Obj) { int Id = ObjIds.GenerateId(); diff --git a/Ryujinx/OsHle/Handles/HSessionObj.cs b/Ryujinx/OsHle/Handles/HSessionObj.cs index c1e5e41a4c..d2b2b0d78a 100644 --- a/Ryujinx/OsHle/Handles/HSessionObj.cs +++ b/Ryujinx/OsHle/Handles/HSessionObj.cs @@ -1,6 +1,8 @@ +using System; + namespace Ryujinx.OsHle.Handles { - class HSessionObj : HSession + class HSessionObj : HSession, IDisposable { public object Obj { get; private set; } @@ -8,5 +10,21 @@ namespace Ryujinx.OsHle.Handles { this.Obj = Obj; } + + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool Disposing) + { + if(Disposing && Obj != null) + { + if(Obj is IDisposable DisposableObj) + { + DisposableObj.Dispose(); + } + } + } } } \ No newline at end of file diff --git a/Ryujinx/OsHle/Ipc/IpcHandler.cs b/Ryujinx/OsHle/Ipc/IpcHandler.cs index ff90d873b3..c373d2cef6 100644 --- a/Ryujinx/OsHle/Ipc/IpcHandler.cs +++ b/Ryujinx/OsHle/Ipc/IpcHandler.cs @@ -212,7 +212,7 @@ namespace Ryujinx.OsHle.Ipc Ns.Os.Handles.ReplaceData(HndId, Dom); - return FillResponse(Response, 0, Dom.GenertateObjectId(Dom)); + return FillResponse(Response, 0, Dom.GenerateObjectId(Dom)); } private static IpcMessage IpcDuplicateSessionEx( diff --git a/Ryujinx/OsHle/Objects/ObjHelper.cs b/Ryujinx/OsHle/Objects/ObjHelper.cs index e37f5320ea..bab2220321 100644 --- a/Ryujinx/OsHle/Objects/ObjHelper.cs +++ b/Ryujinx/OsHle/Objects/ObjHelper.cs @@ -9,7 +9,7 @@ namespace Ryujinx.OsHle.Objects { if (Context.Session is HDomain Dom) { - Context.Response.ResponseObjIds.Add(Dom.GenertateObjectId(Obj)); + Context.Response.ResponseObjIds.Add(Dom.GenerateObjectId(Obj)); } else {