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

Unified Diff: ash/mus/window_manager_application.cc

Issue 2851763002: Update WindowManagerApplication teardown (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager_application.cc
diff --git a/ash/mus/window_manager_application.cc b/ash/mus/window_manager_application.cc
index abd098ed336bb3ff8c5998908a358b2a1a0af6eb..ec6546df39bf514ab8bca8c7e50e942b3bf05a94 100644
--- a/ash/mus/window_manager_application.cc
+++ b/ash/mus/window_manager_application.cc
@@ -38,6 +38,11 @@ namespace mus {
WindowManagerApplication::WindowManagerApplication() {}
WindowManagerApplication::~WindowManagerApplication() {
+ // Verify that we created a WindowManager before attempting to tear everything
+ // down. In some fast running tests OnStart may never have been called.
+ if (!window_manager_.get())
+ return;
+
// Destroy the WindowManager while still valid. This way we ensure
// OnWillDestroyRootWindowController() is called (if it hasn't been already).
window_manager_.reset();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698