Skip to content

Commit

Permalink
Release kMXKAccountAPNSActivityDidChangeNotification observer when de…
Browse files Browse the repository at this point in the history
…allocation controller

Signed-off-by: Nicolas Buquet <[email protected]>
  • Loading branch information
Nicolas Buquet committed Oct 10, 2023
1 parent 94dc313 commit 6b8add7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@ - (void)finalizeInit
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenSettings];
}

- (void)dealloc {
// Remove observers
if (pushInfoUpdateObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:pushInfoUpdateObserver name:kMXKAccountAPNSActivityDidChangeNotification object:nil];
pushInfoUpdateObserver = nil;
}
}

- (void)updateSections
{
NSMutableArray<Section*> *tmpSections = [NSMutableArray arrayWithCapacity:SECTION_TAG_DEACTIVATE_ACCOUNT + 1];
Expand Down
1 change: 1 addition & 0 deletions changelog.d/Settings-controller-dealloc-observer.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove registered observer kMXKAccountAPNSActivityDidChangeNotification in dealloc of SettingsViewController

0 comments on commit 6b8add7

Please sign in to comment.