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

Unified Diff: ash/common/system/status_area_widget.cc

Issue 2745723002: chromeos: Fix shutdown crash in status area teardown on stylus devices (Closed)
Patch Set: remove unnecessary include 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 | ash/focus_cycler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/status_area_widget.cc
diff --git a/ash/common/system/status_area_widget.cc b/ash/common/system/status_area_widget.cc
index 3c66000cc01370b64b51649e41d76620c5f2faeb..25b886e46203ca3a63a5f01bf37bad052aa943fe 100644
--- a/ash/common/system/status_area_widget.cc
+++ b/ash/common/system/status_area_widget.cc
@@ -82,6 +82,10 @@ void StatusAreaWidget::Shutdown() {
// Destroy the trays early, causing them to be removed from the view
// hierarchy. Do not used scoped pointers since we don't want to destroy them
// in the destructor if Shutdown() is not called (e.g. in tests).
+ // Failure to remove the tray views causes layout crashes during shutdown,
+ // for example http://crbug.com/700122.
+ // TODO(jamescook): Find a better way to avoid the layout problems, fix the
+ // tests and switch to std::unique_ptr. http://crbug.com/700255
delete web_notification_tray_;
web_notification_tray_ = nullptr;
// Must be destroyed after |web_notification_tray_|.
@@ -91,10 +95,14 @@ void StatusAreaWidget::Shutdown() {
ime_menu_tray_ = nullptr;
delete virtual_keyboard_tray_;
virtual_keyboard_tray_ = nullptr;
+ delete palette_tray_;
+ palette_tray_ = nullptr;
delete logout_button_tray_;
logout_button_tray_ = nullptr;
delete overview_button_tray_;
overview_button_tray_ = nullptr;
+ // All child tray views have been removed.
+ DCHECK_EQ(0, GetContentsView()->child_count());
}
void StatusAreaWidget::SetShelfAlignment(ShelfAlignment alignment) {
« no previous file with comments | « no previous file | ash/focus_cycler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698