diff --git a/platform/darwin/src/MGLOfflineStorage.mm b/platform/darwin/src/MGLOfflineStorage.mm index a5e0f39330..08457812fd 100644 --- a/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/darwin/src/MGLOfflineStorage.mm @@ -50,7 +50,6 @@ @interface MGLOfflineStorage () @property (nonatomic) std::shared_ptr mbglDatabaseFileSource; @property (nonatomic) std::shared_ptr mbglOnlineFileSource; @property (nonatomic) std::shared_ptr mbglFileSource; -@property (nonatomic, getter=isPaused) BOOL paused; @end @implementation MGLOfflineStorage { @@ -63,10 +62,6 @@ + (instancetype)sharedOfflineStorage { static MGLOfflineStorage *sharedOfflineStorage; dispatch_once(&onceToken, ^{ sharedOfflineStorage = [[self alloc] init]; -#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR - [[NSNotificationCenter defaultCenter] addObserver:sharedOfflineStorage selector:@selector(unpauseFileSource:) name:UIApplicationWillEnterForegroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:sharedOfflineStorage selector:@selector(pauseFileSource:) name:UIApplicationDidEnterBackgroundNotification object:nil]; -#endif [sharedOfflineStorage reloadPacks]; }); @@ -80,28 +75,6 @@ + (instancetype)sharedOfflineStorage { return sharedOfflineStorage; } -#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR -- (void)pauseFileSource:(__unused NSNotification *)notification { - if (self.isPaused) { - return; - } - - _mbglOnlineFileSource->pause(); - _mbglDatabaseFileSource->pause(); - self.paused = YES; -} - -- (void)unpauseFileSource:(__unused NSNotification *)notification { - if (!self.isPaused) { - return; - } - - _mbglOnlineFileSource->resume(); - _mbglDatabaseFileSource->resume(); - self.paused = NO; -} -#endif - - (void)setDelegate:(id)newValue { MGLLogDebug(@"Setting delegate: %@", newValue); _delegate = newValue; @@ -188,7 +161,6 @@ - (instancetype)init { } - (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; [[MGLAccountManager sharedManager] removeObserver:self forKeyPath:@"apiBaseURL"]; [[MGLAccountManager sharedManager] removeObserver:self forKeyPath:@"accessToken"]; diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index ade2c03be1..f88f780b85 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## main + +* Fixed watchdog termination caused by pausing file sources when entering the background. ([#639](https://github.com/mapbox/mapbox-gl-native-ios/pull/639)) + ## 6.4.0 - September 27, 2021 This version does not support Apple Silicon Macs (arm64).