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 @@ -239,14 +239,22 @@ void PerIsolatePlatformData::PostIdleTask(std::unique_ptr<v8::IdleTask> task) {
239239}
240240
241241void PerIsolatePlatformData::PostTask (std::unique_ptr<Task> task) {
242- CHECK_NOT_NULL (flush_tasks_);
242+ if (flush_tasks_ == nullptr ) {
243+ // V8 may post tasks during Isolate disposal. In that case, the only
244+ // sensible path forward is to discard the task.
245+ return ;
246+ }
243247 foreground_tasks_.Push (std::move (task));
244248 uv_async_send (flush_tasks_);
245249}
246250
247251void PerIsolatePlatformData::PostDelayedTask (
248252 std::unique_ptr<Task> task, double delay_in_seconds) {
249- CHECK_NOT_NULL (flush_tasks_);
253+ if (flush_tasks_ == nullptr ) {
254+ // V8 may post tasks during Isolate disposal. In that case, the only
255+ // sensible path forward is to discard the task.
256+ return ;
257+ }
250258 std::unique_ptr<DelayedTask> delayed (new DelayedTask ());
251259 delayed->task = std::move (task);
252260 delayed->platform_data = shared_from_this ();
You can’t perform that action at this time.
0 commit comments