aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/Common
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Common')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs b/Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs
new file mode 100644
index 00000000..098d83d1
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Kernel/Common/OnScopeExit.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace Ryujinx.HLE.HOS.Kernel.Common
+{
+ struct OnScopeExit : IDisposable
+ {
+ private readonly Action _action;
+ public OnScopeExit(Action action) => _action = action;
+ public void Dispose() => _action();
+ }
+}