aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-04-10 15:07:48 +0530
committerRoopesh Chander <roop@roopc.net>2019-04-10 15:42:39 +0530
commit83d0d344112b54d6cd50a4efc697d7122d89e3b2 (patch)
tree1e2f710666f958e5cf1302544fade21f047d2bf8
parentVersion bump (diff)
downloadwireguard-apple-83d0d344112b54d6cd50a4efc697d7122d89e3b2.tar.xz
wireguard-apple-83d0d344112b54d6cd50a4efc697d7122d89e3b2.zip
macOS: Log view: Stop updating the log once the log view is dismissed
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift10
1 files changed, 10 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift
index 3f3a14b..5e86ca2 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/LogViewController.swift
@@ -187,6 +187,16 @@ class LogViewController: NSViewController {
RunLoop.main.add(timer, forMode: .common)
}
+ func stopUpdatingLogEntries() {
+ updateLogEntriesTimer?.invalidate()
+ updateLogEntriesTimer = nil
+ }
+
+ override func viewWillDisappear() {
+ super.viewWillDisappear()
+ stopUpdatingLogEntries()
+ }
+
@objc func saveClicked() {
let savePanel = NSSavePanel()
savePanel.prompt = tr("macSheetButtonExportLog")