mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-31 05:51:47 +00:00
Fix retain cycle warning
This commit is contained in:
@@ -180,7 +180,8 @@ void GetBezierElements(void *info, const CGPathElement *element)
|
|||||||
|
|
||||||
// define our recursive function that will
|
// define our recursive function that will
|
||||||
// help us split the curve up as needed
|
// help us split the curve up as needed
|
||||||
void (^__block flattenCurve)(CGPoint bez[4]) = ^(CGPoint bez[4]){
|
__weak void (^ __block weakFlattenCurve)(CGPoint bez[4]);
|
||||||
|
void (^ __block flattenCurve)(CGPoint bez[4]) = ^(CGPoint bez[4]){
|
||||||
// calculate the error rate of the curve vs
|
// calculate the error rate of the curve vs
|
||||||
// a line segement between the start and end points
|
// a line segement between the start and end points
|
||||||
CGPoint onCurve = bezierPointAtT(bez, .5);
|
CGPoint onCurve = bezierPointAtT(bez, .5);
|
||||||
@@ -196,12 +197,12 @@ void GetBezierElements(void *info, const CGPathElement *element)
|
|||||||
} else {
|
} else {
|
||||||
CGPoint bez1[4], bez2[4];
|
CGPoint bez1[4], bez2[4];
|
||||||
subdivideBezierAtT(bez, bez1, bez2, .5);
|
subdivideBezierAtT(bez, bez1, bez2, .5);
|
||||||
flattenCurve(bez1);
|
weakFlattenCurve(bez1);
|
||||||
flattenCurve(bez2);
|
weakFlattenCurve(bez2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
weakFlattenCurve = flattenCurve;
|
||||||
flattenCurve(bezier);
|
weakFlattenCurve(bezier);
|
||||||
last = curveTo;
|
last = curveTo;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user