Skip to content

Commit becbcc7

Browse files
committed
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 <[email protected]> Reviewed-By: jasnell - James M Snell <[email protected]> Reviewed-By: cjihrig - Colin Ihrig <[email protected]> Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
1 parent 27fd2d7 commit becbcc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -3326,7 +3326,7 @@ void SetupProcessObject(Environment* env,
33263326
#undef READONLY_PROPERTY
33273327

33283328

3329-
static void AtExit() {
3329+
static void AtProcessExit() {
33303330
uv_tty_reset_mode();
33313331
}
33323332

@@ -3363,7 +3363,7 @@ void LoadEnvironment(Environment* env) {
33633363
env->isolate()->SetFatalErrorHandler(node::OnFatalError);
33643364
env->isolate()->AddMessageListener(OnMessage);
33653365

3366-
atexit(AtExit);
3366+
atexit(AtProcessExit);
33673367

33683368
TryCatch try_catch(env->isolate());
33693369

0 commit comments

Comments
 (0)