Skip to content

Commit e7a80d9

Browse files
committed
Fix the retain cycle because of task, fix the progressive main queue dispatch
1 parent 1e32fb6 commit e7a80d9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Storage/FirebaseStorageUI/FUIStorageImageLoader.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ - (BOOL)canRequestImageForURL:(NSURL *)url {
119119
// Get the finish status
120120
BOOL finished = (fetcher.downloadedLength >= fetcher.bodyLength);
121121
// This progress block is callbacked on global queue, so it's OK to decode
122-
UIImage *image = SDImageLoaderDecodeProgressiveImageData(partialData, url, finished, download, options, context);
122+
UIImage *image = SDImageLoaderDecodeProgressiveImageData(partialData, url, finished, task, options, context);
123123
if (image) {
124-
if (completedBlock) {
125-
completedBlock(image, partialData, nil, NO);
126-
}
124+
dispatch_main_async_safe(^{
125+
if (completedBlock) {
126+
completedBlock(image, partialData, nil, NO);
127+
}
128+
});
127129
}
128130
}
129131
NSProgress *progress = snapshot.progress;

0 commit comments

Comments
 (0)