2023-12-04 14:17:13 +01:00
|
|
|
using System;
|
2023-01-04 19:15:45 -03:00
|
|
|
|
|
|
|
namespace Ryujinx.Horizon.Common
|
|
|
|
{
|
2023-06-25 13:40:37 +02:00
|
|
|
public readonly struct OnScopeExit : IDisposable
|
2023-01-04 19:15:45 -03:00
|
|
|
{
|
|
|
|
private readonly Action _action;
|
|
|
|
|
|
|
|
public OnScopeExit(Action action)
|
|
|
|
{
|
|
|
|
_action = action;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
_action();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|