summaryrefslogtreecommitdiffstats
path: root/views/widget/widget_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/widget/widget_win.cc')
-rw-r--r--views/widget/widget_win.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index 8a97b34..5fb5cf8 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -59,7 +59,6 @@ WidgetWin::WidgetWin()
}
WidgetWin::~WidgetWin() {
- MessageLoopForUI::current()->RemoveObserver(this);
}
// static
@@ -1180,8 +1179,10 @@ LRESULT WidgetWin::OnWndProc(UINT message, WPARAM w_param, LPARAM l_param) {
// Otherwise we handle everything else.
if (!ProcessWindowMessage(window, message, w_param, l_param, result))
result = DefWindowProc(window, message, w_param, l_param);
- if (message == WM_NCDESTROY)
+ if (message == WM_NCDESTROY) {
+ MessageLoopForUI::current()->RemoveObserver(this);
OnFinalMessage(window);
+ }
if (message == WM_ACTIVATE)
PostProcessActivateMessage(this, LOWORD(w_param));
if (message == WM_ENABLE && restore_focus_when_enabled_) {