Index: runtime/vm/service_isolate.cc |
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc |
index 3779905093b7a5a401698fb608fec912ad4e4669..f866f31ed987f49e8e5629c578dbda68128d379c 100644 |
--- a/runtime/vm/service_isolate.cc |
+++ b/runtime/vm/service_isolate.cc |
@@ -749,8 +749,30 @@ void ServiceIsolate::Run() { |
} |
+void ServiceIsolate::KillServiceIsolate() { |
+ { |
+ MonitorLocker ml(monitor_); |
+ shutting_down_ = true; |
+ } |
+ Isolate::KillIsolate(isolate_); |
+ { |
+ MonitorLocker ml(monitor_); |
+ while (shutting_down_) { |
+ ml.Wait(); |
+ } |
+ } |
+} |
+ |
+ |
void ServiceIsolate::Shutdown() { |
if (!IsRunning()) { |
+ if (isolate_ != NULL) { |
+ // TODO(johnmccutchan,turnidge) When it is possible to properly create |
+ // the VMService object and set up its shutdown handler in the service |
+ // isolate's main() function, this case will no longer be possible and |
+ // can be removed. |
+ KillServiceIsolate(); |
+ } |
return; |
} |
{ |