From 32a196110db9e6de97155fa6f20b151ad6e1a500 Mon Sep 17 00:00:00 2001 From: theanarkh Date: Sat, 29 Oct 2022 03:38:22 +0800 Subject: [PATCH] src: call uv_library_shutdown before DisposePlatform When the process exits, there may be tasks in the thread pool that need to access data in the platform, such as trace agent. So make sure the thread pool exits first. see /~https://github.com/nodejs/node/pull/44458 --- src/api/environment.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/environment.cc b/src/api/environment.cc index 6bc4033b97da5a9..4d10cbf0f9e3be3 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -773,8 +773,8 @@ void DefaultProcessExitHandlerInternal(Environment* env, ExitCode exit_code) { env->set_can_call_into_js(false); env->stop_sub_worker_contexts(); env->isolate()->DumpAndResetStats(); - DisposePlatform(); uv_library_shutdown(); + DisposePlatform(); Exit(exit_code); }