summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapView.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/MGLMapView.mm')
-rw-r--r--platform/ios/src/MGLMapView.mm14
1 files changed, 11 insertions, 3 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index c679979d37..34269ce442 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -4570,6 +4570,8 @@ public:
return;
}
+ __weak __typeof__(self) weakSelf = self;
+
// The user location callout view initially points to the user location
// annotation’s implicit (visual) frame, which is offset from the
// annotation’s explicit frame. Now the callout view needs to rendezvous
@@ -4583,10 +4585,16 @@ public:
UIViewAnimationOptionBeginFromCurrentState)
animations:^
{
+ __typeof__(self) strongSelf = weakSelf;
+ if ( ! strongSelf)
+ {
+ return;
+ }
+
calloutView.frame = CGRectOffset(calloutView.frame,
- _initialImplicitCalloutViewOffset.x,
- _initialImplicitCalloutViewOffset.y);
- _initialImplicitCalloutViewOffset = CGPointZero;
+ strongSelf->_initialImplicitCalloutViewOffset.x,
+ strongSelf->_initialImplicitCalloutViewOffset.y);
+ strongSelf->_initialImplicitCalloutViewOffset = CGPointZero;
}
completion:NULL];
}