diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 15:57:17 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-28 15:57:17 +0000 |
commit | 436d9e4fba50e9ffe00386bbf5b738219c723922 (patch) | |
tree | c86425d24214396fbf4740ebbe330853a89e1438 | |
parent | a636d8e56d0db4000e4139d00f6033a027a225d2 (diff) | |
download | chromium_src-436d9e4fba50e9ffe00386bbf5b738219c723922.zip chromium_src-436d9e4fba50e9ffe00386bbf5b738219c723922.tar.gz chromium_src-436d9e4fba50e9ffe00386bbf5b738219c723922.tar.bz2 |
Fixes crash in closing window while in workspaces. The crash was
occuring because NativeWidgetAura was deleting the restore bounds but
leaving them on the window so that when WorkspaceLayoutManager also
deleted the restore bounds we crashed. I'm changing NativeWidgetAura
to clear the property. Since obervers are passed the old value I'm
also changing the code to use a scoped_ptr so that the old value
hasn't been deleted when observers are notified.
BUG=none
TEST=none
R=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9479026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123980 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/wm/property_util.cc | 4 | ||||
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ash/wm/property_util.cc b/ash/wm/property_util.cc index 4ae645b..d8db42c 100644 --- a/ash/wm/property_util.cc +++ b/ash/wm/property_util.cc @@ -13,7 +13,7 @@ namespace ash { void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) { - delete GetRestoreBounds(window); + scoped_ptr<const gfx::Rect> old_bounds(GetRestoreBounds(window)); window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); } @@ -27,7 +27,7 @@ const gfx::Rect* GetRestoreBounds(aura::Window* window) { } void ClearRestoreBounds(aura::Window* window) { - delete GetRestoreBounds(window); + scoped_ptr<const gfx::Rect> old_bounds(GetRestoreBounds(window)); window->ClearProperty(aura::client::kRestoreBoundsKey); } diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index dc01169..dba3fbc 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -68,7 +68,7 @@ const gfx::Rect* GetRestoreBounds(aura::Window* window) { } void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) { - delete GetRestoreBounds(window); + scoped_ptr<const gfx::Rect> old_bounds(GetRestoreBounds(window)); window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); } @@ -751,7 +751,8 @@ void NativeWidgetAura::OnWindowDestroying() { tooltip_manager_.reset(); // Cleanup properties associated with the window here. - delete GetRestoreBounds(window_); + scoped_ptr<const gfx::Rect> old_bounds(GetRestoreBounds(window_)); + window_->ClearProperty(aura::client::kRestoreBoundsKey); } void NativeWidgetAura::OnWindowDestroyed() { |