Fix memory issue with ClipPath

Fix memory issue with ClipPath.
This commit is contained in:
Horcrux
2016-11-11 13:25:16 +08:00
parent aae482236d
commit 0434cddc8b
15 changed files with 77 additions and 80 deletions
+2 -2
View File
@@ -94,7 +94,7 @@
{
CGRect rect = [self getRect:context];
// add hit area
self.hitArea = CFAutorelease(CGPathCreateWithRect(rect, nil));
self.hitArea = CGPathCreateWithRect(rect, nil);
[self clip:context];
CGContextSaveGState(context);
@@ -152,7 +152,7 @@
- (CGPathRef)getPath:(CGContextRef)context
{
return CGPathCreateWithRect([self getRect:context], nil);
return (CGPathRef)CFAutorelease(CGPathCreateWithRect([self getRect:context], nil));
}
@end