Commit 731b2a85 authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Reset BVC._voiceSearchController to null in |-shutdown|.

The VoiceSearchController created by VoiceSearchProvider may depend on
state that is no longer valid after shut down.  Reset BVC's pointer to
it early so that shutdown can occur properly when the BVC is later
destroyed.

Bug: 1083208
Change-Id: I05dffce9eb79d353443eae759bc990fb61d74308
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216804
Auto-Submit: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772250}
parent 93a1cb90
...@@ -1321,8 +1321,10 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -1321,8 +1321,10 @@ NSString* const kBrowserViewControllerSnackbarCategory =
_sideSwipeController = nil; _sideSwipeController = nil;
_webStateListObserver.reset(); _webStateListObserver.reset();
_allWebStateObservationForwarder = nullptr; _allWebStateObservationForwarder = nullptr;
if (_voiceSearchController) if (_voiceSearchController) {
_voiceSearchController->SetDispatcher(nil); _voiceSearchController->SetDispatcher(nil);
_voiceSearchController = nullptr;
}
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
} }
......
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