Permalink
Browse files

src: avoid duplicate AtExit functions

node.cc had two functions with the name AtExit with entirely different
purposes:

* node::AtExit(): file static; used to register the atexit(3) handler
  for the Node process.
* node::AtExit(void (*)(void*), void*): publicly exported symbol that
  addons can use to request callbacks upon exit.

For code readability it is better to avoid the unintentional overload.

PR-URL: #8273
Reviewed-By: addaleax - Anna Henningsen <anna@addaleax.net>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information...
ofrobots authored and Fishrock123 committed Aug 25, 2016
1 parent 13a522a commit 0f2c619f55dff24868530e766055802c41dd30c1
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/node.cc
View
@@ -3406,7 +3406,7 @@ void SetupProcessObject(Environment* env,
#undef READONLY_PROPERTY
static void AtExit() {
static void AtProcessExit() {
uv_tty_reset_mode();
}
@@ -3443,7 +3443,7 @@ void LoadEnvironment(Environment* env) {
env->isolate()->SetFatalErrorHandler(node::OnFatalError);
env->isolate()->AddMessageListener(OnMessage);
atexit(AtExit);
atexit(AtProcessExit);
TryCatch try_catch(env->isolate());

0 comments on commit 0f2c619

Please sign in to comment.