macOS: Log view: Stop updating the log once the log view is dismissed

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-04-10 15:07:48 +05:30
parent 8c7c4b6792
commit 83d0d34411
1 changed files with 10 additions and 0 deletions

View File

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