Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[ios] Disable region monitoring when stopping location monitoring #7833

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[ios] Disable region monitoring when stopping location monitoring
Jesse Crocker authored and boundsj committed Feb 16, 2017
commit cf0ba87eb4a2a98d26fc782a6d5bbce18e3bf446
1 change: 1 addition & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Fixed an issue where translucent, non-view-backed point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832))
* Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574))
* Added a `MGLDistanceFormatter` class for formatting geographic distances. ([#7888](https://github.com/mapbox/mapbox-gl-native/pull/7888))
* Fixed an issue that was causing the system location indicator to stay on in background after telemetry was disabled. ([#7833](https://github.com/mapbox/mapbox-gl-native/pull/7833))

## 3.4.1 - January 25, 2017

7 changes: 7 additions & 0 deletions platform/ios/src/MGLLocationManager.m
Original file line number Diff line number Diff line change
@@ -46,6 +46,13 @@ - (void)stopUpdatingLocation {
[self.delegate locationManagerDidStopLocationUpdates:self];
}
}
if(self.standardLocationManager.monitoredRegions.count > 0) {
for(CLRegion *region in self.standardLocationManager.monitoredRegions) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since monitoredRegions are a shared resource we should only call stopMonitoringForRegion: on the (at most) one region this class creates for itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! I see that is happening just below.

if([region.identifier isEqualToString:MGLLocationManagerRegionIdentifier]) {
[self.standardLocationManager stopMonitoringForRegion:region];
}
}
}
}

#pragma mark - Utilities