[ios, osx] Invalidate packs upon reload
This commit is contained in:
committed by
Minh Nguyễn
parent
55f1ad11c4
commit
ec72faa789
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user