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