HSessionObj.cs 642 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. namespace Ryujinx.Core.OsHle.Handles
  3. {
  4. class HSessionObj : HSession, IDisposable
  5. {
  6. public object Obj { get; private set; }
  7. public HSessionObj(HSession Session, object Obj) : base(Session)
  8. {
  9. this.Obj = Obj;
  10. }
  11. public void Dispose()
  12. {
  13. Dispose(true);
  14. }
  15. protected virtual void Dispose(bool Disposing)
  16. {
  17. if (Disposing && Obj != null)
  18. {
  19. if (Obj is IDisposable DisposableObj)
  20. {
  21. DisposableObj.Dispose();
  22. }
  23. }
  24. }
  25. }
  26. }