summaryrefslogtreecommitdiff
path: root/src/common/scope_exit.h
diff options
context:
space:
mode:
authorGravatar bunnei2020-04-17 16:33:08 -0400
committerGravatar GitHub2020-04-17 16:33:08 -0400
commitb8f5c71f2d7f819821acf036175cce65ab1ae12c (patch)
tree151d7ed4e47536dc0e149a7117387b6a502d7da6 /src/common/scope_exit.h
parentMerge pull request #3682 from lioncash/uam (diff)
parentcore: hle: Address various feedback & code cleanup. (diff)
downloadyuzu-b8f5c71f2d7f819821acf036175cce65ab1ae12c.tar.gz
yuzu-b8f5c71f2d7f819821acf036175cce65ab1ae12c.tar.xz
yuzu-b8f5c71f2d7f819821acf036175cce65ab1ae12c.zip
Merge pull request #3666 from bunnei/new-vmm
Implement a new virtual memory manager
Diffstat (limited to 'src/common/scope_exit.h')
-rw-r--r--src/common/scope_exit.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 1176a72b1..68ef5f197 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -12,10 +12,17 @@ template <typename Func>
12struct ScopeExitHelper { 12struct ScopeExitHelper {
13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {} 13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {}
14 ~ScopeExitHelper() { 14 ~ScopeExitHelper() {
15 func(); 15 if (active) {
16 func();
17 }
18 }
19
20 void Cancel() {
21 active = false;
16 } 22 }
17 23
18 Func func; 24 Func func;
25 bool active{true};
19}; 26};
20 27
21template <typename Func> 28template <typename Func>