diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-07-10 16:23:58 -0700 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-07-20 09:46:38 -0700 |
commit | 9332bc2f60b4dd2cc994b9557f03204d0e676509 (patch) | |
tree | 7888afae3df2fffc9aac3aab3d35a34ded4c0833 | |
parent | 8781a5341d61a0da059c49d15d8386bdcece7eb1 (diff) | |
download | qtlocation-mapboxgl-9332bc2f60b4dd2cc994b9557f03204d0e676509.tar.gz |
[ios] Fix an issue where a custom location manager may continue getting updates after set to nil.
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 38ad0c9552..e0b25b9056 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -4689,12 +4689,15 @@ public: - (void)setLocationManager:(id<MGLLocationManager>)locationManager { - _locationManager = locationManager; - _locationManager.delegate = self; - if (!locationManager) { + [self.locationManager stopUpdatingLocation]; + [self.locationManager stopUpdatingHeading]; + self.locationManager.delegate = nil; _showsUserLocation = NO; } + _locationManager = locationManager; + _locationManager.delegate = self; + } - (void)validateLocationServices |