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(); |