summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/base/scope_guard.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/base/scope_guard.h
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/base/scope_guard.h')
-rw-r--r--third_party/jpeg-xl/lib/jxl/base/scope_guard.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/base/scope_guard.h b/third_party/jpeg-xl/lib/jxl/base/scope_guard.h
index a18a44cb79..f060c5bc1d 100644
--- a/third_party/jpeg-xl/lib/jxl/base/scope_guard.h
+++ b/third_party/jpeg-xl/lib/jxl/base/scope_guard.h
@@ -24,8 +24,8 @@ class ScopeGuard {
}
template <typename CallbackParam>
- explicit ScopeGuard(CallbackParam &&callback)
- : callback_(std::forward<CallbackParam>(callback)), armed_(true) {}
+ ScopeGuard(CallbackParam &&callback, bool armed)
+ : callback_(std::forward<CallbackParam>(callback)), armed_(armed) {}
~ScopeGuard() {
if (armed_) callback_();
@@ -40,7 +40,7 @@ class ScopeGuard {
template <typename Callback>
ScopeGuard<Callback> MakeScopeGuard(Callback &&callback) {
- return ScopeGuard<Callback>{std::forward<Callback>(callback)};
+ return ScopeGuard<Callback>{std::forward<Callback>(callback), true};
}
} // namespace jxl