DEPRECATED-mapbox-ios-sdk
DEPRECATED-mapbox-ios-sdk copied to clipboard
Retain cycle in mapView
Hi! I think i found retainCycle. In RMCircle you using code:
@interface RMCircle : RMMapLayer
{
RMMapView *mapView;
....
}
And in RMMapView:
_accuracyCircleAnnotation.layer = [[RMCircle alloc] initWithView:self radiusInMeters:newLocation.horizontalAccuracy];
Instance of RMMapView retaining _accuracyCircleAnnotation, and _accuracyCircleAnnotation retaining instance of RMCircle,which retaining mapView. I have reproduced it in my code. And when I used __weak for ivar in RMCircle, mapView began released.
Yup, there are many nasty cirlces/retaining stuff around annotations and layers code. Hopefully there's some area for clean up.