summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/env.cc7
-rw-r--r--src/node.cc4
-rw-r--r--src/node_internals.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/src/env.cc b/src/env.cc
index d2d5d5bf35..50c718f9e9 100644
--- a/src/env.cc
+++ b/src/env.cc
@@ -859,10 +859,13 @@ void Environment::AsyncHooks::grow_async_ids_stack() {
uv_key_t Environment::thread_local_env = {};
void Environment::Exit(int exit_code) {
- if (is_main_thread())
+ if (is_main_thread()) {
+ stop_sub_worker_contexts();
+ DisposePlatform();
exit(exit_code);
- else
+ } else {
worker_context_->Exit(exit_code);
+ }
}
void Environment::stop_sub_worker_contexts() {
diff --git a/src/node.cc b/src/node.cc
index d5f3f4e6aa..7a585646f6 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -345,6 +345,10 @@ tracing::AgentWriterHandle* GetTracingAgentWriter() {
return v8_platform.GetTracingAgentWriter();
}
+void DisposePlatform() {
+ v8_platform.Dispose();
+}
+
#ifdef __POSIX__
static const unsigned kMaxSignal = 32;
#endif
diff --git a/src/node_internals.h b/src/node_internals.h
index 0b0c97f8c8..fc27b384ec 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -345,6 +345,7 @@ int ThreadPoolWork::CancelWork() {
}
tracing::AgentWriterHandle* GetTracingAgentWriter();
+void DisposePlatform();
static inline const char* errno_string(int errorno) {
#define ERRNO_CASE(e) case e: return #e;