summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLOfflinePack.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLOfflinePack.mm')
-rw-r--r--platform/darwin/src/MGLOfflinePack.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/darwin/src/MGLOfflinePack.mm b/platform/darwin/src/MGLOfflinePack.mm
index 60a7b55531..5e555d425e 100644
--- a/platform/darwin/src/MGLOfflinePack.mm
+++ b/platform/darwin/src/MGLOfflinePack.mm
@@ -227,19 +227,22 @@ NSError *MGLErrorFromResponseError(mbgl::Response::Error error) {
@end
void MBGLOfflineRegionObserver::statusChanged(mbgl::OfflineRegionStatus status) {
+ __weak MBGLOfflinePack *_pack = pack;
dispatch_async(dispatch_get_main_queue(), ^{
- [pack offlineRegionStatusDidChange:status];
+ [_pack offlineRegionStatusDidChange:status];
});
}
void MBGLOfflineRegionObserver::responseError(mbgl::Response::Error error) {
+ __weak MBGLOfflinePack *_pack = pack;
dispatch_async(dispatch_get_main_queue(), ^{
- [pack didReceiveError:MGLErrorFromResponseError(error)];
+ [_pack didReceiveError:MGLErrorFromResponseError(error)];
});
}
void MBGLOfflineRegionObserver::mapboxTileCountLimitExceeded(uint64_t limit) {
+ __weak MBGLOfflinePack *_pack = pack;
dispatch_async(dispatch_get_main_queue(), ^{
- [pack didReceiveMaximumAllowedMapboxTiles:limit];
+ [_pack didReceiveMaximumAllowedMapboxTiles:limit];
});
}