Commit 7e37b21a authored by Balazs Engedy's avatar Balazs Engedy Committed by Commit Bot

Make ChromeAuthenticatorDialogDelegate clean up more tidy.

This is a follow-up to crrev.com/c/964448, which was committed before
a comment around this was addressed.

Bug: 849323
Change-Id: I5c6de00476424a566081a55b5bb2f2ef787c4cb6
TBR: tapted@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/1092857
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565636}
parent 64cd55fd
...@@ -73,10 +73,14 @@ ChromeAuthenticatorRequestDelegate::~ChromeAuthenticatorRequestDelegate() { ...@@ -73,10 +73,14 @@ ChromeAuthenticatorRequestDelegate::~ChromeAuthenticatorRequestDelegate() {
// Currently, completion of the request is indicated by //content destroying // Currently, completion of the request is indicated by //content destroying
// this delegate. // this delegate.
if (weak_dialog_model_) { if (weak_dialog_model_) {
// The dialog model may be destroyed after the OnRequestComplete call.
weak_dialog_model_->RemoveObserver(this);
weak_dialog_model_->OnRequestComplete(); weak_dialog_model_->OnRequestComplete();
} }
// The dialog model may be destroyed after the OnRequestComplete call.
if (weak_dialog_model_) {
weak_dialog_model_->RemoveObserver(this);
weak_dialog_model_ = nullptr;
}
} }
base::WeakPtr<ChromeAuthenticatorRequestDelegate> base::WeakPtr<ChromeAuthenticatorRequestDelegate>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment