diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-20 11:37:34 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-20 11:37:34 +0000 |
commit | 28b5556eb282296431ad6122d5eccb95141f8550 (patch) | |
tree | 6ddbe1653845829ff97b6d2fac8a317b20327248 /ash/shell.cc | |
parent | 922307f6970b1d83bb12597ff94c36d3a4f99ae2 (diff) | |
download | chromium_src-28b5556eb282296431ad6122d5eccb95141f8550.zip chromium_src-28b5556eb282296431ad6122d5eccb95141f8550.tar.gz chromium_src-28b5556eb282296431ad6122d5eccb95141f8550.tar.bz2 |
Fix dependency on scoped_ptr::reset sequencing in ash::DisplayController
scoped_ptr<T>::reset() currently guarantees that it deletes the old
stored pointer before assigning its argument to the stored pointer.
This is unsafe, because getting the deleter may result in the
destruction of the scoped_ptr<T> itself. unique_ptr<T> addresses this by
assigning its argument to the stored pointer before deleting the old
value of the stored pointer.
Unfortunately, this breaks code that assumes that the value of the
scoped_ptr will not change during scoped_ptr::reset() before destruction
of the old value is complete.
BUG=176091
Review URL: https://chromiumcodereview.appspot.com/12296033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell.cc')
-rw-r--r-- | ash/shell.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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(); |