/ src / Ryujinx.Horizon.Common / OnScopeExit.cs
OnScopeExit.cs
 1  using System;
 2  
 3  namespace Ryujinx.Horizon.Common
 4  {
 5      public readonly struct OnScopeExit : IDisposable
 6      {
 7          private readonly Action _action;
 8  
 9          public OnScopeExit(Action action)
10          {
11              _action = action;
12          }
13  
14          public void Dispose()
15          {
16              _action();
17          }
18      }
19  }