]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commit
UI: use NotificationToken to properly clean up observers
authorAndrej Mihajlov <and@mullvad.net>
Tue, 22 Dec 2020 10:09:18 +0000 (11:09 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 22 Dec 2020 11:46:30 +0000 (12:46 +0100)
commit631286e2d12670e44ff9c74f9608ea740773228a
tree0e3fbec237adec504db1bc797682215f41b22720
parent74cd7041dcd78261832b04fff92a6e1219be345d
UI: use NotificationToken to properly clean up observers

When the variable goes out of scope, the observer isn't removed unless
an explicit call is made to the token.

Signed-off-by: Andrej Mihajlov <and@mullvad.net>
Sources/Shared/NotificationToken.swift [new file with mode: 0644]
Sources/WireGuardApp/Tunnel/TunnelsManager.swift
Sources/WireGuardApp/UI/macOS/ViewController/LogViewController.swift
WireGuard.xcodeproj/project.pbxproj