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