[ios, osx] Invalidate packs upon reload

This commit is contained in:
Minh Nguyễn
2016-03-26 14:12:37 -07:00
committed by Minh Nguyễn
parent 55f1ad11c4
commit ec72faa789
2 changed files with 4 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Invalidates the pack and ensures that no future progress update can ever
revalidate it.
revalidate it. This method must be called before the pack is deallocated.
*/
- (void)invalidate;

View File

@@ -195,6 +195,9 @@ NSString * const MGLOfflinePackMaximumCountUserInfoKey = @"MaximumCount";
- (void)reloadPacks {
[self getPacksWithCompletionHandler:^(NS_ARRAY_OF(MGLOfflinePack *) *packs, __unused NSError * _Nullable error) {
for (MGLOfflinePack *pack in self.packs) {
[pack invalidate];
}
self.packs = [packs mutableCopy];
for (MGLOfflinePack *pack in packs) {