Skip to content

Commit

Permalink
[DuckPlayer] 14. Potential fix to crash (#3161)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1204099484721401/1207925784532201/f

Description:
Properly cancels publisher on deInit
  • Loading branch information
afterxleep authored Jul 31, 2024
1 parent 1671ba0 commit 59a65cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DuckDuckGo/DuckPlayer/DuckPlayerSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ final class DuckPlayerSettings: DuckPlayerSettingsProtocol {
}

deinit {
NotificationCenter.default.removeObserver(self)
isFeatureEnabledCancellable?.cancel()
NotificationCenter.default.removeObserver(self, name: AppUserDefaults.Notifications.duckPlayerSettingsUpdated, object: nil)
}
}

0 comments on commit 59a65cd

Please sign in to comment.