| Index: chrome/browser/ui/cocoa/login_prompt_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm
|
| index b3dde5f02daea378464ba2609cbce3d61285c5a2..a259ccfe28edb0367a529a070f30408b49921f90 100644
|
| --- a/chrome/browser/ui/cocoa/login_prompt_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/login_prompt_cocoa.mm
|
| @@ -77,16 +77,20 @@ class LoginHandlerMac : public LoginHandler,
|
| initWithCustomWindow:[sheet_controller_ window]]);
|
| constrained_window_.reset(new ConstrainedWindowMac(
|
| this, requesting_contents, sheet));
|
| - SetDialog(constrained_window_.get());
|
|
|
| NotifyAuthNeeded();
|
| }
|
|
|
| + virtual void CloseDialog() OVERRIDE {
|
| + // The hosting WebContentsModalDialog may have been freed.
|
| + if (constrained_window_)
|
| + constrained_window_->CloseWebContentsModalDialog();
|
| + }
|
| +
|
| // Overridden from ConstrainedWindowMacDelegate:
|
| virtual void OnConstrainedWindowClosed(
|
| ConstrainedWindowMac* window) OVERRIDE {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - SetDialog(NULL);
|
| SetModel(NULL);
|
| ReleaseSoon();
|
|
|
|
|