Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-11-02 22:28:41 +0300
committerMyles Borins <mylesborins@google.com>2019-11-17 10:59:05 +0300
commit5f4535a97c478036533516081597cecbe3259aec (patch)
tree28730b85f42b18d847286929e6d966c4cfef533c /src/env.cc
parent44968f0edc70cfb5fc01715b0e53dcc274bde11a (diff)
src: make AtExit() callbacks run in reverse order
This makes the actual behaviour match the documented (and arguably the correct) behaviour. PR-URL: https://github.com/nodejs/node/pull/30230 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r--src/env.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/env.cc b/src/env.cc
index ff1868e75ec..dd326adf2aa 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -637,7 +637,7 @@ void Environment::RunAtExitCallbacks() {
}
void Environment::AtExit(void (*cb)(void* arg), void* arg) {
- at_exit_functions_.push_back(ExitCallback{cb, arg});
+ at_exit_functions_.push_front(ExitCallback{cb, arg});
}
void Environment::RunAndClearNativeImmediates() {