| Index: ios/chrome/browser/ui/browser_view_controller.mm
|
| diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
|
| index cb1e56afcabd1d4421180ff0af3e45acb873b8d0..643c889196e65680dfed87fa42d2444b42968837 100644
|
| --- a/ios/chrome/browser/ui/browser_view_controller.mm
|
| +++ b/ios/chrome/browser/ui/browser_view_controller.mm
|
| @@ -471,9 +471,6 @@ NSString* const kNativeControllerTemporaryKey = @"NativeControllerTemporaryKey";
|
| // YES if waiting for a foreground tab due to expectNewForegroundTab.
|
| BOOL _expectingForegroundTab;
|
|
|
| - // Whether or not -shutdown has been called.
|
| - BOOL _isShutdown;
|
| -
|
| // The ChromeBrowserState associated with this BVC.
|
| ios::ChromeBrowserState* _browserState; // weak
|
|
|
| @@ -992,7 +989,19 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
|
| }
|
|
|
| - (void)dealloc {
|
| - DCHECK(_isShutdown) << "-shutdown must be called before dealloc.";
|
| + _tabStripController = nil;
|
| + _infoBarContainer = nil;
|
| + _readingListMenuNotifier = nil;
|
| + if (_bookmarkModel)
|
| + _bookmarkModel->RemoveObserver(_bookmarkModelBridge.get());
|
| + [_model removeObserver:self];
|
| + [[UpgradeCenter sharedInstance] unregisterClient:self];
|
| + [[NSNotificationCenter defaultCenter] removeObserver:self];
|
| + [_toolbarController setDelegate:nil];
|
| + if (_voiceSearchController)
|
| + _voiceSearchController->SetDelegate(nil);
|
| + [_rateThisAppDialog setDelegate:nil];
|
| + [_model closeAllTabs];
|
| }
|
|
|
| #pragma mark - Accessibility
|
| @@ -2258,25 +2267,6 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
|
| }));
|
| }
|
|
|
| -- (void)shutdown {
|
| - DCHECK(!_isShutdown);
|
| - _isShutdown = YES;
|
| -
|
| - _tabStripController = nil;
|
| - _infoBarContainer = nil;
|
| - _readingListMenuNotifier = nil;
|
| - if (_bookmarkModel)
|
| - _bookmarkModel->RemoveObserver(_bookmarkModelBridge.get());
|
| - [_model removeObserver:self];
|
| - [[UpgradeCenter sharedInstance] unregisterClient:self];
|
| - [[NSNotificationCenter defaultCenter] removeObserver:self];
|
| - [_toolbarController setDelegate:nil];
|
| - if (_voiceSearchController)
|
| - _voiceSearchController->SetDelegate(nil);
|
| - [_rateThisAppDialog setDelegate:nil];
|
| - [_model closeAllTabs];
|
| -}
|
| -
|
| #pragma mark - SnapshotOverlayProvider methods
|
|
|
| - (NSArray*)snapshotOverlaysForTab:(Tab*)tab {
|
|
|