File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -244,14 +244,22 @@ void PerIsolatePlatformData::PostIdleTask(std::unique_ptr<v8::IdleTask> task) {
244244}
245245
246246void PerIsolatePlatformData::PostTask (std::unique_ptr<Task> task) {
247- CHECK_NOT_NULL (flush_tasks_);
247+ if (flush_tasks_ == nullptr ) {
248+ // V8 may post tasks during Isolate disposal. In that case, the only
249+ // sensible path forward is to discard the task.
250+ return ;
251+ }
248252 foreground_tasks_.Push (std::move (task));
249253 uv_async_send (flush_tasks_);
250254}
251255
252256void PerIsolatePlatformData::PostDelayedTask (
253257 std::unique_ptr<Task> task, double delay_in_seconds) {
254- CHECK_NOT_NULL (flush_tasks_);
258+ if (flush_tasks_ == nullptr ) {
259+ // V8 may post tasks during Isolate disposal. In that case, the only
260+ // sensible path forward is to discard the task.
261+ return ;
262+ }
255263 std::unique_ptr<DelayedTask> delayed (new DelayedTask ());
256264 delayed->task = std::move (task);
257265 delayed->platform_data = shared_from_this ();
You can’t perform that action at this time.
0 commit comments