From 7c616731ac7cd2cf542a3d41078f7b9c6dc869bd Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Thu, 4 Jun 2009 19:47:11 +0000 Subject: Fix crash 12519: in views::DialogClientView::AcceptWindow() We don't have repro steps for this crash so this is a blind fix. But looking at the function that crashes and the history of this file I see: Ben's r11070 and r11047: Which add this check. Ben's r11132: Which removes this check (according to the comments it is a test to see if we can get away with it). It looks to me like the check would prevent the crash and since this is still crashing, I am proposing we re-add it. BUG=12519 TEST=We'll need to verify this by checking the crash dumps sent from the field. Review URL: http://codereview.chromium.org/119183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17651 0039d316-1c4b-4281-b951-d872f2087c98 --- views/window/dialog_client_view.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'views/window') diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc index f59831e..b81e75f 100644 --- a/views/window/dialog_client_view.cc +++ b/views/window/dialog_client_view.cc @@ -369,6 +369,11 @@ bool DialogClientView::AcceleratorPressed(const Accelerator& accelerator) { // DialogClientView, ButtonListener implementation: void DialogClientView::ButtonPressed(Button* sender) { + // We NULL check the delegate here since the buttons can receive WM_COMMAND + // messages even after they (and the window containing us) are destroyed. + if (!GetDialogDelegate()) + return; + if (sender == ok_button_) { AcceptWindow(); } else if (sender == cancel_button_) { -- cgit v1.1