From fcd5ada1cc784becba4bd09663f9985321e0b53a Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Tue, 4 Oct 2016 16:37:03 -0700 Subject: [PATCH] disallow pointer reuse --- platform/darwin/src/MGLMultiPoint.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/darwin/src/MGLMultiPoint.mm b/platform/darwin/src/MGLMultiPoint.mm index ef9099e4825..5bf363d024a 100644 --- a/platform/darwin/src/MGLMultiPoint.mm +++ b/platform/darwin/src/MGLMultiPoint.mm @@ -90,7 +90,11 @@ - (void)getCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range - (void)setCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range { - if (range.length == 0) + if (coords == _coordinates) + { + [NSException raise:NSRangeException format:@"Reuse of existing coordinates array %p not supported", coords]; + } + else if (range.length == 0) { [NSException raise:NSRangeException format:@"Empty coordinate range %@", NSStringFromRange(range)]; }