Index: src/libplatform/default-platform.cc |
diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc |
index 2885d55de7066c19546cee6a82587ffa3b050ad9..2e13cc09042a896a62aec3525890f8d72a22eb3d 100644 |
--- a/src/libplatform/default-platform.cc |
+++ b/src/libplatform/default-platform.cc |
@@ -41,19 +41,24 @@ DefaultPlatform::~DefaultPlatform() { |
base::LockGuard<base::Mutex> guard(&lock_); |
queue_.Terminate(); |
if (initialized_) { |
- for (std::vector<WorkerThread*>::iterator i = thread_pool_.begin(); |
- i != thread_pool_.end(); ++i) { |
+ for (auto i = thread_pool_.begin(); i != thread_pool_.end(); ++i) { |
delete *i; |
} |
} |
- for (std::map<v8::Isolate*, std::queue<Task*> >::iterator i = |
- main_thread_queue_.begin(); |
- i != main_thread_queue_.end(); ++i) { |
+ for (auto i = main_thread_queue_.begin(); i != main_thread_queue_.end(); |
+ ++i) { |
while (!i->second.empty()) { |
delete i->second.front(); |
i->second.pop(); |
} |
} |
+ for (auto i = main_thread_delayed_queue_.begin(); |
+ i != main_thread_delayed_queue_.end(); ++i) { |
+ while (!i->second.empty()) { |
+ delete i->second.top().second; |
+ i->second.pop(); |
+ } |
+ } |
} |