From 83d0d344112b54d6cd50a4efc697d7122d89e3b2 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Wed, 10 Apr 2019 15:07:48 +0530 Subject: macOS: Log view: Stop updating the log once the log view is dismissed Signed-off-by: Roopesh Chander --- .../WireGuard/UI/macOS/ViewController/LogViewController.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) 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") -- cgit v1.2.3-59-g8ed1b