Index: ash/shell.cc |
diff --git a/ash/shell.cc b/ash/shell.cc |
index 7c36c8ef48c7c5490940813466a39ebad3366d2d..5ab5939c8f5bb9078238bc41a234479e6fa51067 100644 |
--- a/ash/shell.cc |
+++ b/ash/shell.cc |
@@ -476,6 +476,15 @@ void Shell::ShowShelf() { |
(*iter)->ShowShelf(); |
} |
+void Shell::HideShelf() { |
+ RootWindowControllerList controllers = GetAllRootWindowControllers(); |
+ for (RootWindowControllerList::iterator iter = controllers.begin(); |
+ iter != controllers.end(); ++iter) { |
+ if ((*iter)->shelf()) |
+ (*iter)->shelf()->ShutdownStatusAreaWidget(); |
+ } |
+} |
+ |
void Shell::AddShellObserver(ShellObserver* observer) { |
observers_.AddObserver(observer); |
} |
@@ -720,7 +729,9 @@ Shell::~Shell() { |
logout_confirmation_controller_.reset(); |
#endif |
- // Destroy SystemTrayDelegate before destroying the status area(s). |
+ // Destroy SystemTrayDelegate before destroying the status area(s). Make sure |
+ // to deinitialize the shelf first, as it is initialized after the delegate. |
+ HideShelf(); |
system_tray_delegate_->Shutdown(); |
system_tray_delegate_.reset(); |