diff --git a/MTMR/Widgets/CurrencyBarItem.swift b/MTMR/Widgets/CurrencyBarItem.swift index 1d1bbde..dfe3479 100644 --- a/MTMR/Widgets/CurrencyBarItem.swift +++ b/MTMR/Widgets/CurrencyBarItem.swift @@ -127,4 +127,8 @@ class CurrencyBarItem: CustomButtonTouchBarItem { newTitle.setAlignment(.center, range: NSRange(location: 0, length: title.count)) attributedTitle = newTitle } + + deinit { + activity.invalidate() + } } diff --git a/MTMR/Widgets/WeatherBarItem.swift b/MTMR/Widgets/WeatherBarItem.swift index 711e00a..61ffeac 100644 --- a/MTMR/Widgets/WeatherBarItem.swift +++ b/MTMR/Widgets/WeatherBarItem.swift @@ -135,4 +135,8 @@ class WeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate { // print("inside didChangeAuthorization "); updateWeather() } + + deinit { + activity.invalidate() + } } diff --git a/MTMR/Widgets/YandexWeatherBarItem.swift b/MTMR/Widgets/YandexWeatherBarItem.swift index 0d4f9ab..6df2149 100644 --- a/MTMR/Widgets/YandexWeatherBarItem.swift +++ b/MTMR/Widgets/YandexWeatherBarItem.swift @@ -121,6 +121,10 @@ class YandexWeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate func locationManager(_: CLLocationManager, didChangeAuthorization _: CLAuthorizationStatus) { updateWeather() } + + deinit { + activity.invalidate() + } } extension String {