summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-29 13:58:33 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-29 13:58:33 +0000
commit5d56a995f7e7bdab7e36bb47d297e25e01b6ad96 (patch)
tree884fd330e55f123453546b86954f2f890c758661
parent29fa0779506ac3249c710131d6b2818f3f731c7b (diff)
downloadchromium_src-5d56a995f7e7bdab7e36bb47d297e25e01b6ad96.zip
chromium_src-5d56a995f7e7bdab7e36bb47d297e25e01b6ad96.tar.gz
chromium_src-5d56a995f7e7bdab7e36bb47d297e25e01b6ad96.tar.bz2
Fixes crash in SaveWindowPlacement. It's possible to get a WM_CLOSE
after a WM_DESTROY. The current code in WM_DESTROY removes the properties, which means if we get a WM_CLOSE after WM_DESTROY we can't locate the profile and end up using local_state prefs, which haven't had the pref registered and we crash. The fix is to remove the properties in OnFinalMessage. BUG=91396 TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/7741044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98633 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--views/widget/native_widget_win.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index 8be88ba..2701173 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -1272,8 +1272,6 @@ void NativeWidgetWin::OnDestroy() {
RevokeDragDrop(hwnd());
drop_target_ = NULL;
}
-
- props_.reset();
}
void NativeWidgetWin::OnDisplayChange(UINT bits_per_pixel, CSize screen_size) {
@@ -2052,6 +2050,9 @@ void NativeWidgetWin::OnWindowPosChanged(WINDOWPOS* window_pos) {
}
void NativeWidgetWin::OnFinalMessage(HWND window) {
+ // We don't destroy props in WM_DESTROY as we may still get messages after
+ // WM_DESTROY that assume the properties are still valid (such as WM_CLOSE).
+ props_.reset();
delegate_->OnNativeWidgetDestroyed();
if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET)
delete this;