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")