aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/KSession.cs
blob: 4b21d3a63862db2d080752d13c82e462a08c1573 (plain) (blame)
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
31
using Ryujinx.HLE.HOS.Services;
using System;

namespace Ryujinx.HLE.HOS.Kernel
{
    class KSession : IDisposable
    {
        public IpcService Service { get; private set; }

        public string ServiceName { get; private set; }

        public KSession(IpcService Service, string ServiceName)
        {
            this.Service     = Service;
            this.ServiceName = ServiceName;
        }

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

        protected virtual void Dispose(bool Disposing)
        {
            if (Disposing && Service is IDisposable DisposableService)
            {
                DisposableService.Dispose();
            }
        }
    }
}