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