From a92286d6daa11fc280b47d904d27c4b61d5e7ad2 Mon Sep 17 00:00:00 2001 From: Clemens Hammacher Date: Tue, 22 Jan 2019 13:44:33 +0100 Subject: [PATCH] src: ensure no more platform foreground tasks after Deinit Node first calls `Isolate::Dispose`, then `NodePlatform::UnregisterIsolate`. This again calls `PerIsolatePlatformData::Shutdown`, which (before this patch) called `FlushForegroundTasksInternal`, which might call `RunForegroundTask` if it finds foreground tasks to be executed. This will fail however, since `Isolate::GetCurrent` was already reset during `Isolate::Dispose`. Hence remove the check to `FlushForegroundTasksInternal` and add checks instead that no more foreground tasks are scheduled. Refs: https://github.com/v8/node/pull/86 Backport-PR-URL: https://github.com/nodejs/node/pull/26048 PR-URL: https://github.com/nodejs/node/pull/25653 Reviewed-By: Gus Caplan Reviewed-By: Colin Ihrig --- src/node_platform.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node_platform.cc b/src/node_platform.cc index fd8d045404ecc7..f6c122991ff967 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -259,7 +259,6 @@ void PerIsolatePlatformData::Shutdown() { if (flush_tasks_ == nullptr) return; - while (FlushForegroundTasksInternal()) {} CancelPendingDelayedTasks(); uv_close(reinterpret_cast(flush_tasks_),