diff --git a/platform/ios/platform/darwin/src/MGLOfflinePack.mm b/platform/ios/platform/darwin/src/MGLOfflinePack.mm index e5f742bf3..e6e61d3f5 100644 --- a/platform/ios/platform/darwin/src/MGLOfflinePack.mm +++ b/platform/ios/platform/darwin/src/MGLOfflinePack.mm @@ -144,11 +144,12 @@ private: MGLOfflineStorage *sharedOfflineStorage = [MGLOfflineStorage sharedOfflineStorage]; __weak MGLOfflinePack *weakSelf = self; [sharedOfflineStorage getPacksWithCompletionHandler:^(NSArray *packs, __unused NSError * _Nullable error) { + MGLOfflinePack *strongSelf = weakSelf; for (MGLOfflinePack *pack in packs) { if (pack.mbglOfflineRegion->getID() == regionID) { - weakSelf.mbglOfflineRegion = pack.mbglOfflineRegion; - break; + strongSelf.mbglOfflineRegion = pack.mbglOfflineRegion; } + [pack invalidate]; } completion(error); }]; diff --git a/platform/ios/platform/ios/test/CI.xctestplan b/platform/ios/platform/ios/test/CI.xctestplan index b7e4d3762..bb29095f0 100644 --- a/platform/ios/platform/ios/test/CI.xctestplan +++ b/platform/ios/platform/ios/test/CI.xctestplan @@ -31,8 +31,7 @@ "testTargets" : [ { "skippedTests" : [ - "MGLMapSnapshotterTests\/testLocalGlyphRendering", - "MGLOfflineStorageTests\/testAddPackForBounds" + "MGLMapSnapshotterTests\/testLocalGlyphRendering" ], "target" : { "containerPath" : "container:ios.xcodeproj", diff --git a/platform/ios/platform/macos/test/CI.xctestplan b/platform/ios/platform/macos/test/CI.xctestplan index 78f265433..cfdf87c5d 100644 --- a/platform/ios/platform/macos/test/CI.xctestplan +++ b/platform/ios/platform/macos/test/CI.xctestplan @@ -21,8 +21,7 @@ "testTargets" : [ { "skippedTests" : [ - "MGLMapSnapshotterTests\/testLocalGlyphRendering", - "MGLOfflineStorageTests\/testAddPackForBounds" + "MGLMapSnapshotterTests\/testLocalGlyphRendering" ], "target" : { "containerPath" : "container:macos.xcodeproj",