summaryrefslogtreecommitdiffstats
path: root/ui/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-04 07:16:33 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-04 07:16:33 +0000
commitd84270ce249331dd0dbc1d27f1250cf2b5111b45 (patch)
treedf783a5e95d41c732bbb1bf5c65b5a7a256a2695 /ui/views
parentd7d2dc63052408fdacf9655ce127b1472272fe9f (diff)
downloadchromium_src-d84270ce249331dd0dbc1d27f1250cf2b5111b45.zip
chromium_src-d84270ce249331dd0dbc1d27f1250cf2b5111b45.tar.gz
chromium_src-d84270ce249331dd0dbc1d27f1250cf2b5111b45.tar.bz2
Fixes possible crash in HWNDMessageHandler
Need to handle the possibility of this being deleted during dispatch BUG=347861 TEST=see bug R=ben@chromium.org Review URL: https://codereview.chromium.org/185453002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r--ui/views/win/hwnd_message_handler.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 79b7eb5..174be80 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -2063,8 +2063,11 @@ void HWNDMessageHandler::OnSysCommand(UINT notification_code,
// with the mouse/touch/keyboard, we flag as being in a size loop.
if ((notification_code & sc_mask) == SC_SIZE)
in_size_loop_ = true;
+ base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr());
DefWindowProc(hwnd(), WM_SYSCOMMAND, notification_code,
MAKELPARAM(point.x(), point.y()));
+ if (!ref.get())
+ return;
in_size_loop_ = false;
}
}