DEPRECATED-mapbox-ios-sdk icon indicating copy to clipboard operation
DEPRECATED-mapbox-ios-sdk copied to clipboard

Retain cycle in mapView

Open chchrn opened this issue 10 years ago • 1 comments

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.

chchrn avatar May 20 '15 04:05 chchrn

Yup, there are many nasty cirlces/retaining stuff around annotations and layers code. Hopefully there's some area for clean up.

username0x0a avatar May 20 '15 13:05 username0x0a