Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: views/widget/native_widget_win.cc

Issue 7741044: Fixes crash in SaveWindowPlacement. It's possible to get a WM_CLOSE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_win.cc
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index 8c20b03447cc2f7ba6c215f3332846583e3806ec..e6f0896421230fe933b51b556b9d99b14d79fdcd 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -1270,8 +1270,6 @@ void NativeWidgetWin::OnDestroy() {
RevokeDragDrop(hwnd());
drop_target_ = NULL;
}
-
- props_.reset();
}
void NativeWidgetWin::OnDisplayChange(UINT bits_per_pixel, CSize screen_size) {
@@ -2050,6 +2048,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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698