From 436d9e4fba50e9ffe00386bbf5b738219c723922 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Tue, 28 Feb 2012 15:57:17 +0000 Subject: 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 --- ash/wm/property_util.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ash') 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 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 old_bounds(GetRestoreBounds(window)); window->ClearProperty(aura::client::kRestoreBoundsKey); } -- cgit v1.1