From efabe72c817a145caa9d2d7aa6da3edf8109e691 Mon Sep 17 00:00:00 2001 From: bsudekum Date: Mon, 8 Feb 2016 10:27:25 -0800 Subject: [PATCH] Dont ref coord after freeing it --- ios/RCTMapboxGL/RCTMapboxGLManager.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/RCTMapboxGL/RCTMapboxGLManager.m b/ios/RCTMapboxGL/RCTMapboxGLManager.m index 8a42ee5..22d459a 100644 --- a/ios/RCTMapboxGL/RCTMapboxGLManager.m +++ b/ios/RCTMapboxGL/RCTMapboxGLManager.m @@ -477,9 +477,9 @@ NSObject *convertObjectToPolyline (NSObject *annotationObject) 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) @@ -537,8 +537,8 @@ NSObject *convertObjectToPolygon (NSObject *annotationObject) 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 \ No newline at end of file