2018-02-10 18:31:40 +00:00
|
|
|
using System;
|
|
|
|
|
2018-02-04 23:08:20 +00:00
|
|
|
namespace Ryujinx.OsHle.Handles
|
|
|
|
{
|
2018-02-10 18:31:40 +00:00
|
|
|
class HSessionObj : HSession, IDisposable
|
2018-02-04 23:08:20 +00:00
|
|
|
{
|
|
|
|
public object Obj { get; private set; }
|
|
|
|
|
|
|
|
public HSessionObj(HSession Session, object Obj) : base(Session)
|
|
|
|
{
|
|
|
|
this.Obj = Obj;
|
|
|
|
}
|
2018-02-10 18:31:40 +00:00
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
Dispose(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool Disposing)
|
|
|
|
{
|
2018-02-14 02:43:08 +00:00
|
|
|
if (Disposing && Obj != null)
|
2018-02-10 18:31:40 +00:00
|
|
|
{
|
2018-02-14 02:43:08 +00:00
|
|
|
if (Obj is IDisposable DisposableObj)
|
2018-02-10 18:31:40 +00:00
|
|
|
{
|
|
|
|
DisposableObj.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-04 23:08:20 +00:00
|
|
|
}
|
|
|
|
}
|