Fix timer in MSC.app that monitors for managedsoftwareupdate failing to start or ending unexpectedly.

This commit is contained in:
Greg Neagle
2019-01-04 13:39:00 -08:00
parent 0f5ece3059
commit 31e4afa266
2 changed files with 7 additions and 7 deletions
@@ -16,7 +16,7 @@ class MSCStatusController: NSObject {
// Handles status messages from managedsoftwareupdate
var session_started = false
var got_status_update = false
var timer: Timer?
var timer: Timer? = nil
var _status_restartAlertDismissed = false
var _status_stopBtnDisabled = false
@@ -58,11 +58,11 @@ class MSCStatusController: NSObject {
// process failure
timeout_counter = 6
saw_process = false
timer = Timer(timeInterval: 5.0,
target: self,
selector: #selector(self.checkProcess),
userInfo: nil,
repeats: true)
timer = Timer.scheduledTimer(timeInterval: 5.0,
target: self,
selector: #selector(self.checkProcess),
userInfo: nil,
repeats: true)
}
@objc func checkProcess() {
@@ -44,7 +44,7 @@ class MunkiStatusViewController: NSViewController {
view.window?.orderFrontRegardless()
timer = Timer.scheduledTimer(timeInterval: 5.0,
target: self,
selector: #selector(MunkiStatusViewController.checkProcess),
selector: #selector(self.checkProcess),
userInfo: nil,
repeats: true)
}