diff --git a/DuckDuckGo/NetworkProtectionTunnelController.swift b/DuckDuckGo/NetworkProtectionTunnelController.swift index fe6e1620ee..c7b8ebee6d 100644 --- a/DuckDuckGo/NetworkProtectionTunnelController.swift +++ b/DuckDuckGo/NetworkProtectionTunnelController.swift @@ -322,7 +322,8 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr private func subscribeToConfigurationChanges() { notificationCenter.publisher(for: .NEVPNConfigurationChange) .receive(on: DispatchQueue.main) - .sink { _ in + .sink { [weak self] _ in + guard let self = self else { return } Task { @MainActor in guard let manager = self.internalManager else { return @@ -346,7 +347,9 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr private func subscribeToStatusChanges() { notificationCenter.publisher(for: .NEVPNStatusDidChange) - .sink(receiveValue: handleStatusChange(_:)) + .sink { [weak self] value in + self?.handleStatusChange(value) + } .store(in: &cancellables) }