diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 18:22:43 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 18:22:43 +0000 |
commit | bc2acc9e288acbc0204f86a72ed173ead7bbd94a (patch) | |
tree | 63c4b6cc0ba254ba4b853b3dfd526b07d823840a /ui/aura | |
parent | 3ac082b45619bd3841fd3065c189f2dc7f908677 (diff) | |
download | chromium_src-bc2acc9e288acbc0204f86a72ed173ead7bbd94a.zip chromium_src-bc2acc9e288acbc0204f86a72ed173ead7bbd94a.tar.gz chromium_src-bc2acc9e288acbc0204f86a72ed173ead7bbd94a.tar.bz2 |
Fixes regression where ~Window would crash if layer was never created.
BUG=none
TEST=covered by unit tests.
R=ben@chromium.org
TBR=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9296014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/window.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index b628a92..1418597 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -101,9 +101,11 @@ Window::~Window() { FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this)); - // The layer will either be destroyed by layer_owner_'s dtor, or by whoever - // acquired it. - layer_->set_delegate(NULL); + // If we have layer it will either be destroyed by layer_owner_'s dtor, or by + // whoever acquired it. We don't have a layer if Init() wasn't invoked, which + // can happen in tests. + if (layer_) + layer_->set_delegate(NULL); layer_ = NULL; } |