mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Fixed a concurrent modification error in caching app images
This commit is contained in:
@@ -50,10 +50,12 @@
|
|||||||
- (void) retrieveAssetForApp:(App*)app useCache:(BOOL)useCache {
|
- (void) retrieveAssetForApp:(App*)app useCache:(BOOL)useCache {
|
||||||
UIImage* appImage = nil;
|
UIImage* appImage = nil;
|
||||||
if (useCache) {
|
if (useCache) {
|
||||||
UIImage* cachedImage = [_imageCache objectForKey:app.appId];
|
@synchronized(_imageCache) {
|
||||||
if (cachedImage != nil) {
|
UIImage* cachedImage = [_imageCache objectForKey:app.appId];
|
||||||
appImage = cachedImage;
|
if (cachedImage != nil) {
|
||||||
app.appImage = appImage;
|
appImage = cachedImage;
|
||||||
|
app.appImage = appImage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (appImage == nil) {
|
if (appImage == nil) {
|
||||||
@@ -62,7 +64,9 @@
|
|||||||
appImage = [UIImage imageWithData:appAsset];
|
appImage = [UIImage imageWithData:appAsset];
|
||||||
app.appImage = appImage;
|
app.appImage = appImage;
|
||||||
if (appImage != nil) {
|
if (appImage != nil) {
|
||||||
[_imageCache setObject:appImage forKey:app.appId];
|
@synchronized(_imageCache) {
|
||||||
|
[_imageCache setObject:appImage forKey:app.appId];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[self performSelectorOnMainThread:@selector(sendCallBackForApp:) withObject:app waitUntilDone:NO];
|
[self performSelectorOnMainThread:@selector(sendCallBackForApp:) withObject:app waitUntilDone:NO];
|
||||||
|
|||||||
Reference in New Issue
Block a user