Skip to content

Commit be76a69

Browse files
Fix for a potential memory leak
One line fix to cover a potential memory leak.
1 parent 6bd01d2 commit be76a69

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

UIImageView+Letters/UIImageView+Letters.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ - (UIImage *)imageSnapshotFromText:(NSString *)text backgroundColor:(UIColor *)c
124124
CGPathRef path = CGPathCreateWithEllipseInRect(self.bounds, NULL);
125125
CGContextAddPath(context, path);
126126
CGContextClip(context);
127+
CGPathRelease(path);
127128
}
128129

129130
//

UIImageViewLettersSample/UIImageViewLettersSample/UIImageView+Letters/UIImageView+Letters.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ - (UIImage *)imageSnapshotFromText:(NSString *)text backgroundColor:(UIColor *)c
124124
CGPathRef path = CGPathCreateWithEllipseInRect(self.bounds, NULL);
125125
CGContextAddPath(context, path);
126126
CGContextClip(context);
127+
CGPathRelease(path);
127128
}
128129

129130
//

0 commit comments

Comments
 (0)