Index: services/ui/service.cc |
diff --git a/services/ui/service.cc b/services/ui/service.cc |
index c58d1b8abe4391bb13f708d91f1afe8c3954220b..a11b3927d83fbe97ab80bd40f3fba19d7649dcff 100644 |
--- a/services/ui/service.cc |
+++ b/services/ui/service.cc |
@@ -231,8 +231,10 @@ void Service::OnFirstDisplayReady() { |
void Service::OnNoMoreDisplays() { |
// We may get here from the destructor, in which case there is no messageloop. |
- if (base::MessageLoop::current()) |
+ if (base::MessageLoop::current() && |
+ base::MessageLoop::current()->is_running()) { |
base::MessageLoop::current()->QuitWhenIdle(); |
+ } |
} |
bool Service::IsTestConfig() const { |