Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: chrome/browser/login_prompt_mac.mm

Issue 194095: Fix crash when closing tab with an open http auth sheet. (Closed)
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/login_prompt_mac.mm
diff --git a/chrome/browser/login_prompt_mac.mm b/chrome/browser/login_prompt_mac.mm
index 99bbaba5f882ca79a807f317dc4fe369081607de..db3569bde4e04aefcbab62f54ec25aa20daebcf5 100644
--- a/chrome/browser/login_prompt_mac.mm
+++ b/chrome/browser/login_prompt_mac.mm
@@ -62,6 +62,8 @@ class LoginHandlerMac : public LoginHandler,
}
void SetModel(LoginModel* model) {
+ if (login_model_)
+ login_model_->SetObserver(NULL);
login_model_ = model;
if (login_model_)
login_model_->SetObserver(this);
@@ -164,6 +166,14 @@ class LoginHandlerMac : public LoginHandler,
this, &LoginHandlerMac::SendNotifications));
}
+ // Close sheet if it's still open, as required by
+ // ConstrainedWindowMacDelegate.
+ DCHECK(MessageLoop::current() == ui_loop_);
+ if (is_sheet_open())
+ [NSApp endSheet:sheet()];
+
+ SetModel(NULL);
+
// Delete this object once all InvokeLaters have been called.
request_loop_->ReleaseSoon(FROM_HERE, this);
}
@@ -209,11 +219,6 @@ class LoginHandlerMac : public LoginHandler,
void CloseContentsDeferred() {
DCHECK(MessageLoop::current() == ui_loop_);
- // Close sheet if it's still open, as required by
- // ConstrainedWindowMacDelegate.
- if (is_sheet_open())
- [NSApp endSheet:sheet()];
-
// The hosting ConstrainedWindow may have been freed.
if (dialog_)
dialog_->CloseConstrainedWindow();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698