Open chchrn opened 9 years ago
I have a bug with this issue.
I have a class with
@property (nonatomic, weak) IBOutlet RMMapView *mapView;
Possible workaround I've found:
- (void)dealloc
{
[self removeObservers];
self.mapView.delegate = nil;
// !!!: Workaround for https://github.com/mapbox/mapbox-ios-sdk/issues/634 !!!
RMMapScrollView *mapScrollViewPrivate = [self.mapView valueForKey:@"_mapScrollView"];
if (mapScrollViewPrivate)
{
mapScrollViewPrivate.delegate = nil;
}
// !!!
}
I think this is not safety:
Property "delegate" of UIScrollView is assign, not weak. In dealloc method your didn't set _mapScrollView.delegate to nil. This is a possible problem, because instance of UIScrollView can send a message to dealloced object.