Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1859)

Unified Diff: components/mus/mus_app.cc

Issue 1827453002: Handful of changes to get mus to shutdown correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/gles2/gpu_state.cc ('k') | components/mus/ws/platform_display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/mus_app.cc
diff --git a/components/mus/mus_app.cc b/components/mus/mus_app.cc
index 9f226a9f8d99c6d5bab5380c98f1c6e4a66ac995..8128d020a583e233917c31c7935c55129cddfefc 100644
--- a/components/mus/mus_app.cc
+++ b/components/mus/mus_app.cc
@@ -69,10 +69,13 @@ struct MandolineUIServicesApp::UserState {
MandolineUIServicesApp::MandolineUIServicesApp() {}
MandolineUIServicesApp::~MandolineUIServicesApp() {
- if (platform_display_init_params_.gpu_state)
- platform_display_init_params_.gpu_state->StopThreads();
// Destroy |window_server_| first, since it depends on |event_source_|.
+ // WindowServer (or more correctly its Displays) may have state that needs to
+ // be destroyed before GpuState as well.
window_server_.reset();
+
+ if (platform_display_init_params_.gpu_state)
+ platform_display_init_params_.gpu_state->StopThreads();
}
void MandolineUIServicesApp::InitializeResources(mojo::Connector* connector) {
@@ -181,7 +184,9 @@ void MandolineUIServicesApp::OnFirstDisplayReady() {
}
void MandolineUIServicesApp::OnNoMoreDisplays() {
- base::MessageLoop::current()->QuitWhenIdle();
+ // We may get here from the destructor, in which case there is no messageloop.
+ if (base::MessageLoop::current())
+ base::MessageLoop::current()->QuitWhenIdle();
}
scoped_ptr<ws::WindowTreeBinding>
« no previous file with comments | « components/mus/gles2/gpu_state.cc ('k') | components/mus/ws/platform_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698