aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Handles/HSessionObj.cs
blob: ed0530f74c47c1f9e460109f8f0b234c6fa2ca60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;

namespace Ryujinx.Core.OsHle.Handles
{
    class HSessionObj : HSession, IDisposable
    {
        public object Obj { get; private set; }

        public HSessionObj(HSession Session, object Obj) : base(Session)
        {
            this.Obj = Obj;
        }

        public void Dispose()
        {
            Dispose(true);
        }

        protected virtual void Dispose(bool Disposing)
        {
            if (Disposing && Obj != null)
            {
                if (Obj is IDisposable DisposableObj)
                {
                    DisposableObj.Dispose();
                }
            }
        }
    }
}