Commit cc4300a6 authored by Livvie Lin's avatar Livvie Lin Committed by Commit Bot

[iOS] Remove observer in IOSChromeControllerClient destructor

App was crashing when trying to navigate from an interstitial page
(forward, backward, back to safety). Remove WebStateObserver in
both the destructor and WebStateDestroyed so that both navigations
and closing the page are covered.

Bug: 1066445
Change-Id: Iace4d26edbaec1ccc26a9b6c410a4de827c5be7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2130777
Commit-Queue: Livvie Lin <livvielin@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755505}
parent d2cae304
...@@ -32,7 +32,11 @@ IOSChromeControllerClient::IOSChromeControllerClient( ...@@ -32,7 +32,11 @@ IOSChromeControllerClient::IOSChromeControllerClient(
web_state_->AddObserver(this); web_state_->AddObserver(this);
} }
IOSChromeControllerClient::~IOSChromeControllerClient() {} IOSChromeControllerClient::~IOSChromeControllerClient() {
if (web_state_) {
web_state_->RemoveObserver(this);
}
}
void IOSChromeControllerClient::SetWebInterstitial( void IOSChromeControllerClient::SetWebInterstitial(
web::WebInterstitial* web_interstitial) { web::WebInterstitial* web_interstitial) {
......
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