diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2020-05-16 12:39:53 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2020-05-23 19:59:25 +0300 |
commit | 8ddb6aa88694f4a5a2a05a46f66508c683b850d2 (patch) | |
tree | 6e06017fe67d54bb0377e1c39b95031fb854a1e8 /src/env.cc | |
parent | a3f47b111499416e5d164c5957af4f504a9e3c48 (diff) |
src: remove BeforeExit callback list
It obscures the fact that there is only a single BeforeExit action.
Just call that statically from `EmitBeforeExit()`.
PR-URL: https://github.com/nodejs/node/pull/33386
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/env.cc b/src/env.cc index 8214936d794..4e7c975902b 100644 --- a/src/env.cc +++ b/src/env.cc @@ -373,13 +373,6 @@ Environment::Environment(IsolateData* isolate_data, } destroy_async_id_list_.reserve(512); - BeforeExit( - [](void* arg) { - Environment* env = static_cast<Environment*>(arg); - if (!env->destroy_async_id_list()->empty()) - AsyncWrap::DestroyAsyncIdsCallback(env); - }, - this); performance_state_ = std::make_unique<performance::PerformanceState>(isolate()); @@ -677,19 +670,6 @@ void Environment::RunCleanup() { } } -void Environment::RunBeforeExitCallbacks() { - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "BeforeExit", this); - 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(ExitCallback{cb, arg}); -} - void Environment::RunAtExitCallbacks() { TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), "AtExit", this); |