diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-09-02 15:41:04 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-09-06 01:15:28 +0300 |
commit | e326c41fbc3ac6533630704bf438db860731dcc6 (patch) | |
tree | 922123af661dfd548faaa48dc407254466950567 /src/api | |
parent | ec5958f38e27f1005fe77719f180d48363677b27 (diff) |
src: shutdown libuv before exit()
This ensures that no operations will be running on the libuv
threadpool, which is important because they may run into race
conditions with the global destructors being triggered from
`exit()`, such as in the added test example here.
PR-URL: https://github.com/nodejs/node/pull/35021
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/environment.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/api/environment.cc b/src/api/environment.cc index a99201e7621..6cd2c6c34a1 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -705,6 +705,7 @@ void DefaultProcessExitHandler(Environment* env, int exit_code) { env->set_can_call_into_js(false); env->stop_sub_worker_contexts(); DisposePlatform(); + uv_library_shutdown(); exit(exit_code); } |