File tree 1 file changed +10
-2
lines changed
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) {
239
239
}
240
240
241
241
void 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
+ }
243
247
foreground_tasks_.Push (std::move (task));
244
248
uv_async_send (flush_tasks_);
245
249
}
246
250
247
251
void PerIsolatePlatformData::PostDelayedTask (
248
252
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
+ }
250
258
std::unique_ptr<DelayedTask> delayed (new DelayedTask ());
251
259
delayed->task = std::move (task);
252
260
delayed->platform_data = shared_from_this ();
You can’t perform that action at this time.
0 commit comments