diff options
author | Clemens Hammacher <clemensh@chromium.org> | 2019-01-22 13:44:33 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-01-27 16:18:02 +0100 |
commit | bafd80883ce2b7ac8f92f31119243af1473269f3 (patch) | |
tree | 5d5d1c0c485691164f0fbcd9779f380236883ebc /src | |
parent | 5109e42629d41902cda6a598a4ddb7c3ef36f5b1 (diff) | |
download | android-node-v8-bafd80883ce2b7ac8f92f31119243af1473269f3.tar.gz android-node-v8-bafd80883ce2b7ac8f92f31119243af1473269f3.tar.bz2 android-node-v8-bafd80883ce2b7ac8f92f31119243af1473269f3.zip |
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
PR-URL: https://github.com/nodejs/node/pull/25653
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_platform.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_platform.cc b/src/node_platform.cc index 047cb43268..797d4d9cbb 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -265,7 +265,8 @@ void PerIsolatePlatformData::Shutdown() { if (flush_tasks_ == nullptr) return; - while (FlushForegroundTasksInternal()) {} + CHECK_NULL(foreground_delayed_tasks_.Pop()); + CHECK_NULL(foreground_tasks_.Pop()); CancelPendingDelayedTasks(); uv_close(reinterpret_cast<uv_handle_t*>(flush_tasks_), |