Skip to content

Commit b65c9bd

Browse files
authored
Merge pull request #46 from ifbowen/feature/leak_#wenbo
fix decode animated image leak
2 parents 52eca55 + 334f61b commit b65c9bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ - (UIImage *)decodedImageWithData:(NSData *)data options:(SDImageCoderOptions *)
149149
#else
150150
UIImage *image = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp];
151151
#endif
152+
CGImageRelease(imageRef);
152153
NSTimeInterval duration = decoder->imageTiming.duration; // Should use `decoder->imageTiming`, not the `decoder->duration`, see libavif source code
153154
SDImageFrame *frame = [SDImageFrame frameWithImage:image duration:duration];
154155
[frames addObject:frame];

0 commit comments

Comments
 (0)