Commit 82c82774 authored by sczs's avatar sczs Committed by Commit Bot

[ios] Nulls historyServices when stopping HistoryCoordinator

HistoryCoordinator owns _browsingHistoryService, which is instantiated on start
but its never niled on stop. Since HistoryCoordinator is long lived and
never gets deallocated, _browsingHistoryService keeps listening for notifications.

When the App is being shutdown _browsingHistoryService gets notified of an
Auth change and HistoryTableVC (of which _browsingHistoryDriver holds a reference
of) tries to react accordingly. Since the user is no longer logged in this causes
a background Crash.

This CL nils both pointers so they stop observing once HistoryCoordinator has
been stopped.

Bug: 867452
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Id99b4ab481d90eca3a380d5b090631c263b65ef3
Reviewed-on: https://chromium-review.googlesource.com/1171250Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582714}
parent fd47d8d8
...@@ -108,6 +108,8 @@ ...@@ -108,6 +108,8 @@
dismissViewControllerAnimated:YES dismissViewControllerAnimated:YES
completion:completionHandler]; completion:completionHandler];
self.historyNavigationController = nil; self.historyNavigationController = nil;
_browsingHistoryDriver = nullptr;
_browsingHistoryService = nullptr;
}; };
if (self.historyClearBrowsingDataCoordinator) { if (self.historyClearBrowsingDataCoordinator) {
[self.historyClearBrowsingDataCoordinator stopWithCompletion:^() { [self.historyClearBrowsingDataCoordinator stopWithCompletion:^() {
......
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