Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index e39912b00d80d87044d98612c4caebabda2c8edc..8cefdeb0a25483440b6b88532bae492b09661185 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -1904,6 +1904,11 @@ void Isolate::Deinit() { |
delete basic_block_profiler_; |
basic_block_profiler_ = NULL; |
+ for (CancelableTask* task : cancelable_tasks_) { |
+ task->Cancel(); |
+ } |
+ cancelable_tasks_.clear(); |
+ |
heap_.TearDown(); |
logger_->TearDown(); |
@@ -2783,6 +2788,18 @@ void Isolate::CheckDetachedContextsAfterGC() { |
} |
+void Isolate::RegisterCancelableTask(CancelableTask* task) { |
+ cancelable_tasks_.insert(task); |
+} |
+ |
+ |
+void Isolate::RemoveCancelableTask(CancelableTask* task) { |
+ auto removed = cancelable_tasks_.erase(task); |
+ USE(removed); |
+ DCHECK(removed == 1); |
+} |
+ |
+ |
bool StackLimitCheck::JsHasOverflowed(uintptr_t gap) const { |
StackGuard* stack_guard = isolate_->stack_guard(); |
#ifdef USE_SIMULATOR |