From 2c6a4fd6fa214d06f220792a02b42eb7f2e7d05d Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Thu, 17 Nov 2022 21:41:04 +0100 Subject: [PATCH] src: don't run tasks on isolate termination Fixes: https://github.com/nodejs/node/issues/45419 PR-URL: https://github.com/nodejs/node/pull/45444 Reviewed-By: Ben Noordhuis Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- src/node_platform.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_platform.cc b/src/node_platform.cc index b87413bcb9cfcb..1d761c345f95e9 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -406,7 +406,7 @@ int NodePlatform::NumberOfWorkerThreads() { } void PerIsolatePlatformData::RunForegroundTask(std::unique_ptr task) { - if (isolate_->IsExecutionTerminating()) return task->Run(); + if (isolate_->IsExecutionTerminating()) return; DebugSealHandleScope scope(isolate_); Environment* env = Environment::GetCurrent(isolate_); if (env != nullptr) {