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; |