Skip to content

Commit 0f2c619

Browse files
ofrobotsFishrock123
authored andcommitted
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>
1 parent 13a522a commit 0f2c619

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3406,7 +3406,7 @@ void SetupProcessObject(Environment* env,
34063406
#undef READONLY_PROPERTY
34073407

34083408

3409-
static void AtExit() {
3409+
static void AtProcessExit() {
34103410
uv_tty_reset_mode();
34113411
}
34123412

@@ -3443,7 +3443,7 @@ void LoadEnvironment(Environment* env) {
34433443
env->isolate()->SetFatalErrorHandler(node::OnFatalError);
34443444
env->isolate()->AddMessageListener(OnMessage);
34453445

3446-
atexit(AtExit);
3446+
atexit(AtProcessExit);
34473447

34483448
TryCatch try_catch(env->isolate());
34493449

0 commit comments

Comments
 (0)