Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm

Issue 2760643002: Unregister from the InstallationNotifier in the dealloc. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698