diff options
author | dharcourt@chromium.org <dharcourt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-26 17:24:49 +0000 |
---|---|---|
committer | dharcourt@chromium.org <dharcourt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-26 17:24:49 +0000 |
commit | d19a9900cf9dd58a04c64632fd674a8bbea7eaf9 (patch) | |
tree | 40ab7bd791ed0cbc36b004cd843403261a38c1ea /apps | |
parent | 2d2e5cc43dbbacf2c2fd71cb290f970a8d677486 (diff) | |
download | chromium_src-d19a9900cf9dd58a04c64632fd674a8bbea7eaf9.zip chromium_src-d19a9900cf9dd58a04c64632fd674a8bbea7eaf9.tar.gz chromium_src-d19a9900cf9dd58a04c64632fd674a8bbea7eaf9.tar.bz2 |
Fixes crasher when closing app windows while printing.
The ShellWindow acts as the delegate of a WebContentsModalDialogManager
for modal panels like the print preview panel. This change clears this
delegation relationship when the ShellWindow is closed by the user,
preventing a crash caused by the WebContentsModalDialogManager accessing
its ShellWindow delegate after ~ShellWindow is called.
There is a manual test case for the crasher in the bug report.
BUG=297179
Review URL: https://codereview.chromium.org/24363008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225484 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps')
-rw-r--r-- | apps/shell_window.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/shell_window.cc b/apps/shell_window.cc index cd8ddd0..4317883 100644 --- a/apps/shell_window.cc +++ b/apps/shell_window.cc @@ -286,8 +286,12 @@ void ShellWindow::RequestToLockMouse(WebContents* web_contents, void ShellWindow::OnNativeClose() { ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); - if (shell_window_contents_) + if (shell_window_contents_) { + WebContents* web_contents = shell_window_contents_->GetWebContents(); + WebContentsModalDialogManager::FromWebContents(web_contents)-> + SetDelegate(NULL); shell_window_contents_->NativeWindowClosed(); + } delete this; } |