Skip to content

Commit

Permalink
Merge pull request nitaliano#268 from mapbox/free
Browse files Browse the repository at this point in the history
Dont reference coord after freeing it
  • Loading branch information
Bobby Sudekum committed Feb 8, 2016
2 parents e75718e + efabe72 commit 2aac972
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ios/RCTMapboxGL/RCTMapboxGLManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ - (NSDictionary *)constantsToExport
count++;
}
}

RCTMGLAnnotationPolyline *polyline = [RCTMGLAnnotationPolyline polylineAnnotation:coord strokeAlpha:strokeAlpha strokeColor:strokeColor strokeWidth:strokeWidth id:id type:@"polyline" count:count];
free(coord);
return [RCTMGLAnnotationPolyline polylineAnnotation:coord strokeAlpha:strokeAlpha strokeColor:strokeColor strokeWidth:strokeWidth id:id type:@"polyline" count:count];
return polyline;
}

NSObject *convertObjectToPolygon (NSObject *annotationObject)
Expand Down Expand Up @@ -537,8 +537,8 @@ - (NSDictionary *)constantsToExport
count++;
}
}

RCTMGLAnnotationPolygon *polygon = [RCTMGLAnnotationPolygon polygonAnnotation:coord fillAlpha:fillAlpha fillColor:fillColor strokeColor:strokeColor strokeAlpha:strokeAlpha id:id type:@"polygon" count:count];
free(coord);
return [RCTMGLAnnotationPolygon polygonAnnotation:coord fillAlpha:fillAlpha fillColor:fillColor strokeColor:strokeColor strokeAlpha:strokeAlpha id:id type:@"polygon" count:count];
return polygon;
}
@end
@end

0 comments on commit 2aac972

Please sign in to comment.