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

Unified Diff: ash/mus/window_manager.cc

Issue 2269473003: ash/mus: Fix a crash during tear down. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: doc Created 4 years, 4 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.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index a0126dba54709d6cca30f958e72029177a585262..964a1dfeaa85851962ed4bc7231afc88b55bc18e 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -214,14 +214,16 @@ void WindowManager::OnDidDestroyClient(ui::WindowTreeClient* client) {
// |root_window_controllers_|.
DCHECK(root_window_controllers_.empty());
+ // Observers can rely on WmShell from the callback. So notify the observers
+ // before destroying it.
+ FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
+ OnWindowTreeClientDestroyed());
+
lookup_.reset();
shell_->Shutdown();
shell_.reset();
shadow_controller_.reset();
- FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
- OnWindowTreeClientDestroyed());
-
pointer_watcher_event_router_.reset();
window_tree_client_ = nullptr;
« 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