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

Commit

Permalink
disallow pointer reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Oct 4, 2016
1 parent d4cb5a3 commit fcd5ada
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion platform/darwin/src/MGLMultiPoint.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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)];
}
Expand Down

0 comments on commit fcd5ada

Please sign in to comment.