Index: ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm |
diff --git a/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm b/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm |
index ae779d460d99537d8a9f595823601f452eff8f86..2ec5fb3b81f8d997a2f67a08c783563ff86c2f18 100644 |
--- a/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm |
+++ b/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm |
@@ -113,6 +113,13 @@ typedef NS_ENUM(NSInteger, ItemType) { |
return self; |
} |
+- (void)dealloc { |
+ [[InstallationNotifier sharedInstance] unregisterForNotifications:self]; |
+ if (!_userDidSomething) |
+ [self recordUserAction:settings::kNativeAppsActionDidNothing]; |
+ [super dealloc]; |
+} |
+ |
#pragma mark - View lifecycle |
- (void)viewDidLoad { |
@@ -139,12 +146,6 @@ typedef NS_ENUM(NSInteger, ItemType) { |
removeObserver:self |
name:UIApplicationDidBecomeActiveNotification |
object:nil]; |
- if ([self isMovingFromParentViewController]) { |
- // The view controller is popped. |
- [[InstallationNotifier sharedInstance] unregisterForNotifications:self]; |
- if (!_userDidSomething) |
- [self recordUserAction:settings::kNativeAppsActionDidNothing]; |
- } |
} |
#pragma mark - CollectionViewController |