mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-08 15:58:35 +00:00
48 lines
1,015 B
C#
48 lines
1,015 B
C#
using System;
|
|
|
|
namespace Ryujinx.Core.OsHle.Handles
|
|
{
|
|
class HDomain : HSession, IDisposable
|
|
{
|
|
private IdDictionary Objects;
|
|
|
|
public HDomain(HSession Session) : base(Session)
|
|
{
|
|
Objects = new IdDictionary();
|
|
}
|
|
|
|
public int Add(object Obj)
|
|
{
|
|
return Objects.Add(Obj);
|
|
}
|
|
|
|
public bool Delete(int Id)
|
|
{
|
|
return Objects.Delete(Id);
|
|
}
|
|
|
|
public object GetObject(int Id)
|
|
{
|
|
return Objects.GetData(Id);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Dispose(true);
|
|
}
|
|
|
|
protected virtual void Dispose(bool Disposing)
|
|
{
|
|
if (Disposing)
|
|
{
|
|
foreach (object Obj in Objects)
|
|
{
|
|
if (Obj != this && Obj is IDisposable DisposableObj)
|
|
{
|
|
DisposableObj.Dispose();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |