mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-10 00:58:37 +00:00
fix: need to properly stop periodic timer/activity on destroy to eliminate possible memory leaks
This commit is contained in:
parent
63e3de7313
commit
2d64c091e3
@ -127,4 +127,8 @@ class CurrencyBarItem: CustomButtonTouchBarItem {
|
||||
newTitle.setAlignment(.center, range: NSRange(location: 0, length: title.count))
|
||||
attributedTitle = newTitle
|
||||
}
|
||||
|
||||
deinit {
|
||||
activity.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,4 +135,8 @@ class WeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate {
|
||||
// print("inside didChangeAuthorization ");
|
||||
updateWeather()
|
||||
}
|
||||
|
||||
deinit {
|
||||
activity.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,6 +121,10 @@ class YandexWeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate
|
||||
func locationManager(_: CLLocationManager, didChangeAuthorization _: CLAuthorizationStatus) {
|
||||
updateWeather()
|
||||
}
|
||||
|
||||
deinit {
|
||||
activity.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user