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

Unified Diff: services/ui/demo/mus_demo.cc

Issue 2764433002: Fix destruction order in mus_demo (Closed)
Patch Set: add more extended comment. destroy env and wm_state explicitly Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/demo/mus_demo.cc
diff --git a/services/ui/demo/mus_demo.cc b/services/ui/demo/mus_demo.cc
index 7afba5693af4cae100e7e13c0f09af916494b989..0efcf0068d68e830a5b12cd917a1d22c381f8f64 100644
--- a/services/ui/demo/mus_demo.cc
+++ b/services/ui/demo/mus_demo.cc
@@ -24,6 +24,14 @@ MusDemo::MusDemo() {}
MusDemo::~MusDemo() {
display::Screen::SetScreenInstance(nullptr);
+ // Destruction order is important here:
+ // 1) Windows must be destroyed before WindowTreeClient's destructor is
+ // called.
+ // 2) WindowTreeClient must be destroyed before Env and WMState.
+ window_tree_data_list_.clear();
+ window_tree_client_.reset();
+ env_.reset();
+ wm_state_.reset();
}
void MusDemo::AddPrimaryDisplay(const display::Display& display) {
« 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