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 @@ -240,14 +240,22 @@ void PerIsolatePlatformData::PostIdleTask(std::unique_ptr<v8::IdleTask> task) {
240
240
}
241
241
242
242
void 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
+ }
244
248
foreground_tasks_.Push (std::move (task));
245
249
uv_async_send (flush_tasks_);
246
250
}
247
251
248
252
void PerIsolatePlatformData::PostDelayedTask (
249
253
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
+ }
251
259
std::unique_ptr<DelayedTask> delayed (new DelayedTask ());
252
260
delayed->task = std::move (task);
253
261
delayed->platform_data = shared_from_this ();
You can’t perform that action at this time.
0 commit comments