summaryrefslogtreecommitdiffstats
path: root/views/window
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 19:47:11 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 19:47:11 +0000
commit7c616731ac7cd2cf542a3d41078f7b9c6dc869bd (patch)
treeecf44f8e59585a6266a042ce39614002653c74f9 /views/window
parentf8488ed876cb8ace3e10a7d5e63a1a881a55b604 (diff)
downloadchromium_src-7c616731ac7cd2cf542a3d41078f7b9c6dc869bd.zip
chromium_src-7c616731ac7cd2cf542a3d41078f7b9c6dc869bd.tar.gz
chromium_src-7c616731ac7cd2cf542a3d41078f7b9c6dc869bd.tar.bz2
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
Diffstat (limited to 'views/window')
-rw-r--r--views/window/dialog_client_view.cc5
1 files changed, 5 insertions, 0 deletions
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_) {