From 639311fa604e9ceae36a498da1328c5ff1cc7de6 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sun, 13 Nov 2022 09:36:15 +0100 Subject: [PATCH] src: don't run tasks on isolate termination Fixes: https://github.com/nodejs/node/issues/45419 --- 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 6085c9487b6bf9..960583390318ca 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) {