summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmkiley <jordan.kiley@mapbox.com>2018-02-12 13:58:31 -0800
committerjmkiley <jordan.kiley@mapbox.com>2018-02-12 13:58:31 -0800
commit1b5a43d4f7ba2e2da7824d1a85eaa1f061e181ca (patch)
tree501543de553a890e5423a0c38be053e1374d9bbf
parent336703e4ee0791077320c73a78ffd115a15cfb20 (diff)
downloadqtlocation-mapboxgl-upstream/jmkiley-cameraDidChange-shapeSource.tar.gz
-rw-r--r--platform/ios/app/MBXViewController.m7
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 4ef8d05536..77f0e27e93 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -1919,11 +1919,14 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
[self updateHUD];
// cameraDidChange called once here
- if ([_features count] >= _count && _count > 0){
+ if ([_features count] >= _count && _count > 0) {
[_features removeObjectAtIndex:0];
- _count = [_features count];
+// _count = [_features count];
MGLShapeCollectionFeature *collection = [MGLShapeCollectionFeature shapeCollectionWithShapes:_features];
_shapeSource.shape = collection;
+ _count -= 1;
+
+ // Uncomment this and the crash happens
// } else {
// _shapeSource.shape = nil;
// _count = 0;