2018-08-16 16:47:36 -07:00
|
|
|
using Ryujinx.HLE.HOS.Services;
|
2018-03-19 11:58:46 -07:00
|
|
|
using System;
|
|
|
|
|
2018-08-16 16:47:36 -07:00
|
|
|
namespace Ryujinx.HLE.HOS.Kernel
|
2018-03-19 11:58:46 -07:00
|
|
|
{
|
|
|
|
class KSession : IDisposable
|
|
|
|
{
|
2018-12-04 12:23:37 -08:00
|
|
|
public IpcService Service { get; }
|
2018-03-19 11:58:46 -07:00
|
|
|
|
2018-12-04 12:23:37 -08:00
|
|
|
public string ServiceName { get; }
|
2018-04-05 22:38:59 -07:00
|
|
|
|
2018-12-04 12:23:37 -08:00
|
|
|
public KSession(IpcService service, string serviceName)
|
2018-03-19 11:58:46 -07:00
|
|
|
{
|
2018-12-04 12:23:37 -08:00
|
|
|
Service = service;
|
|
|
|
ServiceName = serviceName;
|
2018-03-19 11:58:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
Dispose(true);
|
|
|
|
}
|
|
|
|
|
2018-12-04 12:23:37 -08:00
|
|
|
protected virtual void Dispose(bool disposing)
|
2018-03-19 11:58:46 -07:00
|
|
|
{
|
2018-12-04 12:23:37 -08:00
|
|
|
if (disposing && Service is IDisposable disposableService)
|
2018-03-19 11:58:46 -07:00
|
|
|
{
|
2018-12-04 12:23:37 -08:00
|
|
|
disposableService.Dispose();
|
2018-03-19 11:58:46 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|