| Index: runtime/vm/dart.cc
|
| diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
|
| index 024f6530f8bf8dd1d6cfc6635ac8f134c82e403a..96dc5986e72bae70741b1dab41c73609d28e8544 100644
|
| --- a/runtime/vm/dart.cc
|
| +++ b/runtime/vm/dart.cc
|
| @@ -222,10 +222,6 @@ const char* Dart::Cleanup() {
|
| return "VM already terminated.";
|
| }
|
|
|
| - // Disable creation of any new OSThread structures which means no more new
|
| - // threads can do an EnterIsolate.
|
| - OSThread::DisableOSThreadCreation();
|
| -
|
| // Shut down profiling.
|
| Profiler::Shutdown();
|
|
|
| @@ -252,6 +248,11 @@ const char* Dart::Cleanup() {
|
| // before shutting down the thread pool.
|
| WaitForIsolateShutdown();
|
|
|
| + // 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.
|
| + OSThread::DisableOSThreadCreation();
|
| +
|
| // Shutdown the thread pool. On return, all thread pool threads have exited.
|
| delete thread_pool_;
|
| thread_pool_ = NULL;
|
| @@ -276,6 +277,9 @@ const char* Dart::Cleanup() {
|
| } else {
|
| // Shutdown the service isolate.
|
| ServiceIsolate::Shutdown();
|
| +
|
| + // Disable thread creation.
|
| + OSThread::DisableOSThreadCreation();
|
| }
|
|
|
| CodeObservers::DeleteAll();
|
|
|