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