diff --git a/src/env.cc b/src/env.cc index f02cb36fe53f1e..5d2513b520d128 100644 --- a/src/env.cc +++ b/src/env.cc @@ -232,25 +232,25 @@ void Environment::PrintSyncTrace() const { } void Environment::RunBeforeExitCallbacks() { - for (BeforeExitCallback before_exit : before_exit_functions_) { + for (ExitCallback before_exit : before_exit_functions_) { before_exit.cb_(before_exit.arg_); } before_exit_functions_.clear(); } void Environment::BeforeExit(void (*cb)(void* arg), void* arg) { - before_exit_functions_.push_back(BeforeExitCallback{cb, arg}); + before_exit_functions_.push_back(ExitCallback{cb, arg}); } void Environment::RunAtExitCallbacks() { - for (AtExitCallback at_exit : at_exit_functions_) { + for (ExitCallback at_exit : at_exit_functions_) { at_exit.cb_(at_exit.arg_); } at_exit_functions_.clear(); } void Environment::AtExit(void (*cb)(void* arg), void* arg) { - at_exit_functions_.push_back(AtExitCallback{cb, arg}); + at_exit_functions_.push_back(ExitCallback{cb, arg}); } void Environment::AddPromiseHook(promise_hook_func fn, void* arg) { diff --git a/src/env.h b/src/env.h index 8c73b8b206e6ec..c63ee76e2eb0ab 100644 --- a/src/env.h +++ b/src/env.h @@ -823,17 +823,13 @@ class Environment { static const int kFsStatsFieldsLength = 2 * 14; AliasedBuffer fs_stats_field_array_; - struct BeforeExitCallback { + struct ExitCallback { void (*cb_)(void* arg); void* arg_; }; - std::list before_exit_functions_; + std::list before_exit_functions_; - struct AtExitCallback { - void (*cb_)(void* arg); - void* arg_; - }; - std::list at_exit_functions_; + std::list at_exit_functions_; struct PromiseHookCallback { promise_hook_func cb_;