mapbox / DEPRECATED-mapbox-ios-sdk

REPLACED – use https://www.mapbox.com/ios-sdk instead
https://github.com/mapbox/mapbox-gl-native
Other
323 stars 8 forks source link

Retain cycle in mapView #633

Open chchrn opened 9 years ago

chchrn commented 9 years ago

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.

username0x0a commented 9 years ago

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