summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
Diffstat (limited to 'ash')
-rw-r--r--ash/display/display_controller.cc5
-rw-r--r--ash/display/display_controller.h4
-rw-r--r--ash/shell.cc5
3 files changed, 12 insertions, 2 deletions
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index 5bdca9b..2d645a1 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -254,6 +254,10 @@ DisplayController::DisplayController()
}
DisplayController::~DisplayController() {
+ DCHECK(primary_display_for_shutdown);
+}
+
+void DisplayController::Shutdown() {
DCHECK(!primary_display_for_shutdown);
primary_display_for_shutdown = new gfx::Display(
GetDisplayManager()->GetDisplayForId(primary_display_id));
@@ -270,6 +274,7 @@ DisplayController::~DisplayController() {
delete controller;
}
}
+
// static
const gfx::Display& DisplayController::GetPrimaryDisplay() {
DCHECK_NE(primary_display_id, gfx::Display::kInvalidDisplayID);
diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h
index 17b9eb0..2674483 100644
--- a/ash/display/display_controller.h
+++ b/ash/display/display_controller.h
@@ -84,7 +84,9 @@ class ASH_EXPORT DisplayController : public gfx::DisplayObserver {
DisplayController();
virtual ~DisplayController();
- // Retruns primary display. This is safe to use after ash::Shell is
+ void Shutdown();
+
+ // Returns primary display. This is safe to use after ash::Shell is
// deleted.
static const gfx::Display& GetPrimaryDisplay();
diff --git a/ash/shell.cc b/ash/shell.cc
index cd317d7..1a386ea 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -288,7 +288,10 @@ Shell::~Shell() {
power_button_controller_.reset();
session_state_controller_.reset();
- // This also deletes all RootWindows.
+ // This also deletes all RootWindows. Note that we invoke Shutdown() on
+ // DisplayController before resetting |display_controller_|, since destruction
+ // of its owned RootWindowControllers relies on the value.
+ display_controller_->Shutdown();
display_controller_.reset();
screen_position_controller_.reset();