forked from mirrors/linphone-iphone
fix crash because too much iterate timers
This commit is contained in:
parent
61932234d9
commit
8fdbf0ba40
1 changed files with 5 additions and 1 deletions
|
|
@ -41,6 +41,10 @@ import linphonesw
|
|||
}
|
||||
|
||||
@objc func startIterateTimer() {
|
||||
if (mIterateTimer?.isValid ?? false) {
|
||||
Log.directLog(BCTBX_LOG_DEBUG, text: "Iterate timer is already started, skipping ...")
|
||||
return
|
||||
}
|
||||
mIterateTimer = Timer.scheduledTimer(timeInterval: 0.02, target: self, selector: #selector(self.iterate), userInfo: nil, repeats: true)
|
||||
Log.directLog(BCTBX_LOG_DEBUG, text: "start iterate timer")
|
||||
|
||||
|
|
@ -48,8 +52,8 @@ import linphonesw
|
|||
|
||||
@objc func stopIterateTimer() {
|
||||
if let timer = mIterateTimer {
|
||||
timer.invalidate()
|
||||
Log.directLog(BCTBX_LOG_DEBUG, text: "stop iterate timer")
|
||||
timer.invalidate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue