Skip to content

Commit 49674f7

Browse files
backesBethGriggs
authored andcommitted
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: v8#86 PR-URL: nodejs#25653 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 25ca9f1 commit 49674f7

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/node_platform.cc

-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ void PerIsolatePlatformData::Shutdown() {
259259
if (flush_tasks_ == nullptr)
260260
return;
261261

262-
while (FlushForegroundTasksInternal()) {}
263262
CancelPendingDelayedTasks();
264263

265264
uv_close(reinterpret_cast<uv_handle_t*>(flush_tasks_),

0 commit comments

Comments
 (0)