Return back ScopeExit usage.

This commit is contained in:
levlam 2020-12-24 17:16:56 +03:00
parent c1a16acd53
commit 1b92e2d57a

View File

@ -25,7 +25,7 @@ template <int id>
static FileFd &get_file_fd() {
static FileFd result = FileFd::from_native_fd(NativeFd(id, true));
static ExitGuard exit_guard;
static auto guard = SCOPE_EXIT {
static auto guard = ScopeExit() + [&] {
result.move_as_native_fd().release();
};
return result;