| Index: runtime/vm/dart.cc
|
| diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
|
| index 96dc5986e72bae70741b1dab41c73609d28e8544..8a5e91b53ed0f86162fcc9da2480d55eac14cc76 100644
|
| --- a/runtime/vm/dart.cc
|
| +++ b/runtime/vm/dart.cc
|
| @@ -248,15 +248,18 @@ const char* Dart::Cleanup() {
|
| // before shutting down the thread pool.
|
| WaitForIsolateShutdown();
|
|
|
| + // Shutdown the thread pool. On return, all thread pool threads have exited.
|
| + delete thread_pool_;
|
| + thread_pool_ = NULL;
|
| +
|
| // Disable creation of any new OSThread structures which means no more new
|
| // threads can do an EnterIsolate. This must come after isolate shutdown
|
| // because new threads may need to be spawned to shutdown the isolates.
|
| + // This must come after deletion of the thread pool to avoid a race in which
|
| + // a thread spawned by the thread pool does not exit through the thread
|
| + // pool, messing up its bookkeeping.
|
| OSThread::DisableOSThreadCreation();
|
|
|
| - // Shutdown the thread pool. On return, all thread pool threads have exited.
|
| - delete thread_pool_;
|
| - thread_pool_ = NULL;
|
| -
|
| // Set the VM isolate as current isolate.
|
| bool result = Thread::EnterIsolate(vm_isolate_);
|
| ASSERT(result);
|
|
|