Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release kMXKAccountAPNSActivityDidChangeNotification observer when de… #7697

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ - (void)finalizeInit
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenSettings];
}

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

// Fix for destroy not being called
[self destroy];
alfogrillo marked this conversation as resolved.
Show resolved Hide resolved
}

- (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 @@
Call destroy in dealloc to remove all observers of SettingsViewController